The curse on Jaya and Vijaya
There is a curse behind the birth of Hiranyakashyap and Hiranyaksha.
Jaya and Vijaya were the gatekeepers of Vishnu. Once they diasllowed sanath kumaras from meeting Vishnu. Sanath Kumaras cursed them to become mortals. Vishnu provided them some relief. Later Vishnu took four avatars to relieve them of their curse.
After the sanathh kumaras cursed Jaya and Vijaya, they requested Vishnu to lift the curse of the Kumaras. Vishnu says curse of Kumaras cannot be reverted. Instead, he gives Jaya and Vijaya two options. The first option is to take seven births on Earth as a devotee of Vishnu. Another options is to take three births as his enemy. After serving either of these sentences, they can re-attain their stature at Vaikuntha and be with him permanently. Jaya and Vijaya cannot bear the thought of staying away from Vishnu for seven lives. As a result, they choose to be born three times on Earth even though it would have to be as enemies of Vishnu.
Jaya born as Hiranyakashyap, Ravana and Shishupala in various births while Vijaya born as Hiranyaksha, Kumbhkarna and Dantavakra. They killed by Varaha avatar, Narsingh avatar, Rama avatar and Shri Krishna avatar of Lord Vishnu.
There curse has been completed after the killing of Shishupala and Dantavakra. After the death of Dantavakra, just as at the time of Shisupala’s death, in the presence of all persons standing there, a small particle of spiritual effulgence came out of the demon’s body and merged into the body of Lord Krishna. Thus Jaya and Vijaya were united with their lord.
This is noted that the demons power have diminished during their subsequent births. Though killing of Hiranyaksha and Hiranyakashyap was the sole aim of dashavatars, but in dwapar yuga, Shri Krishna avatar had bigger motives than killing of Shishupal and Dantavakra.
This story is available in Bhagwat Purana.