He was the son of Ugrasena, king of Mathura, and a reincarnation of the asura Kalanemi.
Antecedents: Vishnu – Brahma – Atri – Chandra – Budha – Pururavas – Ayus – Nahusha – Yayati – Yadu – Sahasrajit – Shatajit – Hehaya – Dharma – Kunti – Bhadrasena – Dhanaka – Kritavirya – – Kartaviryarjuna – Madhu – Vrishni – Yudhajit – Shini – Satyaka – Satyaki – Jaya – Kuni – Anamitra – Prishni – Chitraratha – Kukura – Vahni – Viloma – Kapotaloma – Tumburu – Dundubhi – Daridra- Vasu – Nahuka – Aahuka – Ugrasena – Kamsa.
In the Swayambhuvamanvantara, Marichi had a wife name Urna and they had six sons. Once, when they saw Brahma, they ridiculed him by calling him an old man who married his daughter. Brahma cursed that they would be born as daityas on earth. They were born later as the sons of Kalanemi as per Devibhagavata Chaturthaskanda. In their next birth, they were born as the sons of Hiranyakashipu. They lived as pious beings then. Brahma was pleased and said they could ask for boons. They asked that no one be able to kill them. Hiranyakashipu was not pleased with this. he cursed that they would become ‘Shadharbhakas’ and sleep in patala for a long time. They pleaded for mercy. He said that after a long sleep, they would be born as the sons of Devaki, Vasudeva’s wife, and at that time, Kamsa, a reincarnation of Kalanemi, their father in their previous birth, would kill them and they would then attain moksha. As per this, they were reborn and killed by Kamsa as per Devibhagavata Sakanda 4 and 10.
Kamsa was not really Ugrasena’s son. This was revealed to him by Narada. Once , in her youth, Ugrasena’s wife was walking in the forests with her maids when Dramila saw her and impregnated her. She was furious and said that since Dramila had made her pregnant using devious means, a child born of her husband’s clan would kill Dramila’s child. Kamsa imprisoned Ugrasena and as per his mother’s words, he died at the hands of Krishna, who belonged to Ugrasena’s clan. Kamsa’s ill treatment of Ugrasena and Krishna can probably be attributed to this as per Bhagavata Dashamaskanda.
Once there was a famous place named Madhuvana on the banks of the Kalindi. It was named after the asura Madhu. Madhu had a son named Lavana. He continuously attacked the devas and was finally killed by Shatrughna, who then established his own kingdom there. The place was then named Mathura. After him, the two sons ruled the place, and after the decline of Suryavanshi kings, it came under the control of Yadavas and was ruled by Shurasena. Shurasena’s son was Vasudeva, Krishna’s father, who gave up the right to the kingdom and began raising cows. Because of that, Ugrasena, another Yadava king had to rule Mathura. Kamsa imprisoned Ugrasena later and began ruling Mathura as per Devibhagavata Chaturthaskanda.
Vasudeva was married to devaki, daughter of Ugrasena and sister of Kamsa. Kamsa gifted them a chariot. Kamsa himself became the charioteer and began driving them through the city. Just then, a divine voice proclaimed that the eighth son of Vasudeva and Devaki would kill Kamsa as Srimadbhagavata Dashamaskanda Chapter 1. Kamsa was enraged on hearing this. He immediately got up, pulled Devaki by her hair with his left hand, took his sword in the right and was about to behead her when Vasudeva pleaded with him to spare her. Vasudeva said that since the eighth son was meant to kill Kamsa, there was no need to kill her just then. He also promised to give all their children to Kamsa as soon as they were born. Kamsa let them go.
Devaki soon gave birth to a son, whom they named Keertiman. Meanwhile Narada informed Kamsa that he was the reincarnation of Kalanemi and that the child who would kill him was an incarnation of Vishnu. Blinded by rage, Kamsa killed Keertiman by smashing his head on the floor and imprisoned Devaki and Vasudeva as per Bhagavata Dashamaskanda.
The asuras Pralamba, Chanura, Trinavarta, Mushtika, Arishtaka, Keshi, Dhenuka, Agha, Vivida, Putana were all in the service of Kamsa. He sent them all out to harass the Yadavas. Many of the Yadavas fled. Ugrasena, who was a devotee of Vishnu, was also tortured. Meanwhile, Devaki had five more sons, all of whom were killed. Her seventh pregnancy ended in a miscarriage. (As per Vishnu’s instructions, Mayadevi lured Devaki’s seventh offspring into the womb of Rohini, another wife of Vasudeva. This child was an incarnation of Anantha. Rohini gave birth to this child who was called Sankarshana, more easily known as Balabhadrarama or Balarama)
Soon after, Vishnu incarnated in Devaki’s womb and Maya in the womb of Yashoda, wife of Nandagopa in Ambadi) Krishna was born and put the guards to sleep. As per his instructions, Vasudeva carried him to Ambadi, placed him beside Yashoda and returned with Yashoda’s child. The guards woke up then and informed Kamsa. Kamsa arrived in a rage and flung the child to the ground, but she slipped out and rising heavenwards told Kamsa that his nemesis was safe in another place. Kamsa was dejected and went back to his palace as per Bhagavata Dashamaskanda.
Kamsa was uncomfortable that the child destined to kill him still lived. He released Vasudeva and Devaki and became thoughtful. His courtiers suggested that if they killed all the children who had been born in the last ten days, then the one destined to kill Kamsa would also be dead. Kamsa agreed and sent his people to do the needful. This group included Putana, Shakata, Trinavarta, Arishtaka, Keshi and though all of them tried to kill Krishna, they were unsuccessful as per Bhagavata Dashamaskanda.
Arishtaka was one of Kamsa’s principal advisors and he took the form of a bull to attack Krishna. Krishna killed him with a single blow, and Narada, who happened to see it, immediately informed Kamsa. Narada also told him that Balarama and Krishna were Vasudeva’s sons and the girl who slipped out of Kamsa’s hands was Yashoda’s. Kamsa was enraged and again imprisoned Vasudeva and Devaki. He then started thinking of ways to lure Balarama and Krishna to Mathura and kill them. He decided to conduct an ayudhapuja (Dhanuryaga) in his capital, and invited the brothers too. He sent Akrura to fetch them. Akrura was a devotee of Krishna and informed Krishna of Kamsa’s plans. Krishna, Balarama and several of their friends made their way to Mathura. When Krishna and Balarama left, several others started crying and some even blamed Akrura. They finally reached Mathura and there, Krishna killed the mad elephant and five wrestlers – Chanura, Mushtika, Shala, Kosala, Kuta, who had been assigned to kill him. Kamsa then laughed from his throne and ordered his soldiers to kill Ugrasena, Vasudeva, Devaki, Krishna, Balarama and all their friends. Krishna became angry, jumped on to the dais, threw Kamsa down and killed him as per Bhagavata Dashamaskanda.
Kamsa was married to Jarasandha’s daughters Asthi and Pratasthi as per Bhagavata Dashamaskanda.
Kamsa was a fierce warrior and hated by all the other kings. He had an army of a crore soldiers, with 8 lakh charioteers, an equal number of elephants and a cavalry of 32 lakhs as per Mahabharata Sabhaparva Chapter 38.