As the Bhagavata Purana tells it
Bhagavata Purana, cantos 3, 7, 9 and 10 · 3 min read
Vaikuntha, Vishnu's own world, has seven gates, and at the seventh, the innermost, stood two guards. Their names were Jaya and Vijaya. They carried maces, and nobody passed them who had no business inside.
One day four small boys came walking up to the gate.
They were not boys. They were the four Kumaras, the sons of Brahma, sages older than most of the gods, who had never grown past the look of children and never would. Anyone who knew them would have bowed to the ground. The guards did not know them. They looked at four children with bare feet and dust on their legs, and they saw four children.
"Not here," said Jaya, and set his mace across the way. "This is no place for children. Go back where you came from."
"We have come to see Vishnu," said one of the four.
"So has everyone," said Vijaya. "Go home."

The four looked at the two. Then the eldest spoke, and his voice was not a child's.
"You have judged us by our faces," he said, "at the one gate in all the worlds where nobody should be judged by his face. You do not belong here. Lose this place. Go down into the world and be born there, far from him, and learn what that is like."
A curse from a sage does not wait to be agreed to. The guards felt it settle on them, and only then did they understand who they had turned away.
Vishnu came out to the gate himself.
He did not scold the four. He did not scold the two. He looked at his gatekeepers, who had fallen at his feet, and he told them the truth.
"A brahmin's curse is not mine to lift," he said. "Not even for me. You will go down, and you will be born. But I can give you a choice about how."
They waited.
"Seven births as my devotees, loving me from far away, and then you come back. Or three births as my enemies, with my hand on you at the end of each, and then you come back. Seven lives, or three."
The two looked at each other. Seven lives away from him. Or three, as the thing he came to kill.
"Three," they said together. "Seven is too long to be away from you."
So it was three.
In the age of truth they were born as two brothers, Hiranyaksha and Hiranyakashipu, asuras who held the three worlds between them. Vishnu came for the first as a boar and killed him. He came for the second out of a pillar, as a shape neither man nor lion, and killed him at dusk in a doorway.
In the age after that they were born as Ravana and Kumbhakarna, the lords of Lanka, and this time it was Rama who came for them, a man with a bow, and killed them both.
In the third age they were born as Shishupala and Dantavakra, kings among men, and each in his turn stood up against Krishna and was killed by him.
The Bhagavata notes one thing about the three births. Each pair was less than the pair before. The asura brothers shook the whole universe; the lords of Lanka troubled one island and one kingdom; the last two were kings among men. The power ran down with every life, as if the curse itself were being used up.
And at the end of the third, the two of them stood again at the seventh gate of Vaikuntha, with their maces in their hands, as if they had never left.
