Devayani’s father, Sukra, was the greatest master of magic of his age, but he served the asuras (demons). The devas (gods) sent Kaca to learn how Sukra made the asuras invincible, and Kaca discovered that whenever the gods killed demons, Sukra restored them to life.
Kaca caused Devayani to fall in love with him, and through her learned the magical power of mritasanjivini (giving life to the dead) from her father, Sukra. But after Kaca mastered the training, he left without marrying Devayani. So she cursed him, so that what he learned would not be of use to him. Kaca cursed her back that no deva would marry her.
After a very long time, King Yayati, a mortal, married Devayani, and she had two sons by him named Yadu and Turvasu. Devayani’s divine ancestry made her a worthy wife for an eminent king of the lunar dynasty (candra-vamsa), thus legitimating this ruling line and giving it semi-divine status.