This scene at Vaikuntha forms the backstory behind four of Vishnu's avatars: Varaha (Boar), Narasimha (Man-Lion), Rama, and Krishna.
Jaya and Vijaya were closely guarding the gates of Vaikuntha (literally, "place of eternal bliss"), the abode of Lord Vishnu and Goddess Lakshmi. They were astonished to see four young boys approaching the gate.
"Stop right there and identify yourselves," Jaya commanded.
"We are the Four Kumaras," the boys cried in unison.
"I am Sanaka," said the first boy.
"I am Sanandana," said the second.
"I am Sanatana," said the third.
"And I am Sanatkumara," said the fourth.
"Why are you here? What do you want?" asked Vijaya.
"We want to see Lord Vishnu," said one of the boys.
"You cannot see Lord Vishnu now, as he is resting," said Jaya.
"Lord Vishnu never rests," said another boy. "If he did, the universe would cease to function."
"We have come a long way to see Lord Vishnu," said the third boy. "Please let us in."
"No," said Vijaya firmly.
"You have misused your position as gatekeepers of Vaikuntha and denied us entry," said the fourth boy. "We hereby curse you: you will be born as demons on Earth three times."
Just then, Vishnu emerged from his chamber and arrived at the gate after hearing the commotion.
"These boys just cursed us for doing our jobs," Jaya and Vijaya complained to Vishnu.
"Your job is not to become a barrier between my devotees and me," Vishnu said. "You have committed a grave error and deserve to be punished."
Vishnu then turned to the Kumaras.
"How long will Jaya and Vijaya have to suffer this curse?" he asked.
"They will live as demons until your avatar kills them in each life," replied one Kumara.
Thus, in the Satya era, Jaya and Vijaya were born as the demons Hiranyakashipu and Hiranyaksha, respectively. In the Treta era, they were born as the demons Ravana and Kumbhakarna. In the Dvapara era, they were born as the demons Shishupala and Dantavakra. Each time, they were slain by an avatar of Vishnu, finally freeing them from the Kumaras' curse.