yada yada hi dharmasya glanir bhavati bharata abhyutthanam adharmasya tadatmanam srjamy aham
Whenever and wherever there is a decline in religious practice, O descendant of Bharata, and a predominant rise of irreligion-at that time I descend Myself.(Bhagvad – Gita 4:7)
Afraid of a prophecy that predicted his death at the hands of the eighth son of Devaki, King Kamsa, the brother of Devaki, had incarcerated the couple in a prison cell. It was there at the stroke of midnight that Lord Krishna appeared before an expecting Devaki in His four-armed Vishnu form, carrying the conch, disc, club and lotus. Devaki and Vasudev, prayed to Him to turn Himself into their baby. The Lord advised Vasudeva to take Him to Gokul and then turned Himself into a new-born baby called Krishna.
Magically, with the appearance of Krishna, the guards in Kamsa's prison fell asleep, and all the iron shackles, chains and locks automatically opened. Wasting no time, Vasudev picked up the baby, and carrying Him in a basket, started towards Gokul. It was a dark stormy night with blinding rain continuously pouring from the sky. When Vasudev reached the bank of river Yamuna, the river was in spate and stormy winds were blowing. Vasudev was in a fix and didn’t know what to do.
Suddenly a miracle happened - the river parted and Vasudev walked through the river. Throughout the journey, Vasudev and the baby were protected from rain by the hood of the great eternal snake, Vasuki. Finally, Vasudev reached Nanda's house in Gokul safely. Krishna was brought up along with his brother, Balram by Yashoda & Nanda in Gokul. Vrindavan and Gokul provided the stage for numerous childhood leelas of the Lord.
The sole objective of Sri Krishna's appearance on earth was to eradicate the evil and establish the true religion.