Jarasandha, the King of Magadha, had married his twin daughters - Asti and Prapti, to Kamsa.
Kamsa was a descendant of the King Yadu. Kamsa imprisoned his own father Ugrasena and he usurped the throne and using the powerful army of his father-in-law, Kamsa ruled over all the Yadavas like a tyrant.
Krishna was Kamsa's nephew.
Before Krishna's birth, there was a prophecy that the eighth child of Devaki - Kamsa's sister - would bring about the death of Kamsa.
Enraged on learning about the prophecy, Kamsa jailed Devaki and her husband Vasudeva and Kamsa killed all the children of the couple as soon as they were born.
Balarama and Krishna, who were the seventh and eighth child of the couple were secretly smuggled out of the prison, on birth.
These two children were extraordinarily gifted individuals.
Balarama was phenomenally strong and it was said that he was an incarnation of Aadi Sesha - the thousand headed snake on which Lord Narayana, the Preserver God, rests - and Aadi Sesha is so powerful that he holds up the very earth on his head.
Krishna is said to be the incarnation of Narayana himself. Krishna means black. Krishna was an extraordinarily handsome man and was exceedingly dark in complexion. Hence his name.
Krishna and his brother grew up among the cowherds called as the Gopas.
After growing up Krishna went in search of his natural parents and there he killed Kamsa in Mathura, thereby fulfilling the prophecy about his birth.
After Kamsa's death, the crown reverted back to Kamsa's father - Ugrasena.
After Kamsa, the Yadavas were unwilling to answer to a single monarch and had broken into several factions. The Yadavas were therefore a republic and each Chieftain was allowed to represent his group.
This way the city of Mathura was given to Krishna. Though Krishna ruled only a single city among the whole of the Yadava kingdom he was a very able administrator and a very charismatic personality. He was loved by all the Yadavas and they all respected him.
After Krishna had killed Kamsa, naturally Jarasandha was furious.
Jarasandha collected a huge army and he attacked Mathura, not once, but eighteen times.
Krishna defeated Jarasandha seventeen times and all the times, he spared Jarasandha's life.
In the eighteenth time, Jarasandha joined forces with another king called Kalayavana and they attacked Mathura on two fronts.
Even before this, Krishna had realized that Mathura was no longer a safe place. Using the services of Vishwakarma, the architect of the Devas, Krishna had the the city of Dwaraka built in the land reclaimed from the seas.
During the eighteenth attack, by Jarasandha, Krishna and Balarama had all their people moved to the kingdom of Dwaraka and with a skeletal army, they faced this dual attack.
Using the help of a great king by name Muchukunda, Krishna killed Kalayavana. But then Krishna's problems were only half over with the death of Kalayavana.
They had decimated Kalayavana's army. But still Jarasandha's army were around them. And this time, Jarasandha had mustered a huge army.
Krishna and Balarama, instead of fighting Jarasandha, they ran from the battlefield!
Jarasandha probably did not know the fate of Kalayavana and thought that his plan of attacking Mathura on two fronts was finally succeeding. Gloating with himself, he and his army people gave a chase to the fleeing Yadava brothers. The brothers ran hard and they reached a mountain called Pravarsana.
(In Sanskrit, Pravarsana means the rainy mountains. It is believed that it is always raining at Pravarsana.)
The two brothers looked at the approaching army and started climbing up the mountain.
Jarasandha was gleeful when he saw the two brothers on the mountain.
Realizing that the two brothers were trapped in the mountain, Jarasandha ordered his men to set fire to the mountains on all sides.
Jarasandha and his men watched with a vicious satisfaction as the mountain burned magnificently. They just made sure that no one escaped the mountain. Jarasandha went back to his kingdom, finally satisfied that he had avenged his son-in-law's killer.
Naturally, Krishna and Balarama escaped the fire. (Some Puranas mention that the two brothers jumped from the mountain for a distance of about 11 Yojanas to escape the fire. Incidentally, 1 Yojana is about 14.63 kilometers.)
It is believed that Krishna and Balarama framed their own deaths because they wanted to start afresh in the city of Dwaraka
Dwaraka was an extremely safe city as it was built on land reclaimed from the sea and it was surrounded by the seas on all sides. Jarasandha could not attack them there.
And the reason, Krishna did not kill Jarasandha was that it was important for Jarasandha to live at that time. Though Krishna ruled his own place, he was more of a kingmaker. He was a close friend and confidante of the Pandavas – the heroes of the Mahabharatha. Krishna realized that if the Pandavas had to be powerful, they had to kill Jarasandha and annex the powerful kingdom of Magadha – and that single move could establish the supremacy of the Pandavas in the entire country.