How did Lord Krishna get involved in the Mahabharata war? What I mean is, Lord Krishna was born and grew up in Vrindavana and was playing with Gopis throughout his childhood, so how did he actually get involved in big battles like the Kurukshetra war? What was the turn of events?
Krishna wasn't actually born in Vrindavana. As described in this chapter of the Srimad Bhagavatam, Krishna was born in Mathura to Vasudeva and Devaki, who had been imprisoned by Devaki's cousin Kamsa because he had heard a prophecy that the eighth son of Devaki would kill him. To protect Krishna, Vasudeva smuggled him out of Kamsa's prison and gave him to Nandagopa and Yashoda. It's after that time that Krishna grew up in Vrindavana and the surrounding areas stealing butter, performing miracles, playing with Gopis, etc. Then he went back to Mathura, killing his evil uncle Kamsa and freeing his biological parents from prison. Kamsa's father Ugrasena was restored as king (as Kamsa had deposed him earlier), Vasudeva was made crown prince, and ever since then Krishna lived as a prince in Mathura. (And except for one or two occasions he never saw Nandagopa and Yashoda again, as I discuss in this answer.)
It's only after returning to Mathura that Krishna started getting involved in the events of the Mahabharata. First of all, Vasudeva's sister was Kunti, mother of (some of) the Pandavas, so Krishna sent his advisor Akrura to Hastinapura to find out how his cousins the Pandavas were being treated by Dhritarashta, as described in this chapter of the Srimad Bhagavatam. And then Krishna and Balarama saw the Pandavas for the first time in the Swayamvara of Draupadi (recognizing them in spite of their disguises), and afterwards he talked to them, as described in the Adi Parva of the Mahabharata:
Then Vasudeva approaching that foremost of virtuous men--the son of Kunti--and touching the feet of that prince of the Ajamida race, said, 'I am Krishna.' And the son of Rohini (Valadeva) also approaching Yudhishthira, did the same. And the Pandavas, beholding Krishna and Valadeva, began to express great delight. And, O thou foremost of the Bharata race, those heroes of the Yadu race thereafter touched also the feet of Kunti, their father's sister. And Ajatasatru, that foremost of the Kuru race, beholding Krishna, enquired after his well-being and asked, 'How, O Vasudeva, hast thou been able to trace us, as we are living in disguise?' And Vasudeva, smilingly answered, 'O king, fire, even if it is covered, can be known. Who else among men than the Pandavas could exhibit such might?'
And ever since then Krishna's association with the Pandavas grew. Arjuna married Krishna's younger sister Subhadra, for instance. (She's the mother of Arjuna's son Abhimanyu.) Later Krishna and Arjuna helped Agni fight off Indra so he could burn down the Khandava forest as I discuss in this answer. And shortly thereafter, since Krishna was an incarnation of Vishnu, Yudishthira made him the chief guest of his Rajasuya Yagna. Krishna continued to help the Pandavas, for instance saving Draupadi from being disrobed as described in this chapter of the Sabha Parva of the Mahabharata. And then after the Pandavas came back from exile, Krishna went as a peace envoy to the Kauravss on behalf of the Pandavas. And last but not least, Krishna of course served as charioteer of Arjuna in the Kurukshetra war.
So to sum up, the reason that Krishna's life changed so dramatically from his days as a cowherd was because he reclaimed his status as a prince once he went back to Mathura and killed Kamsa. And the reason he became so intricately involved in the events of the Mahabharata is that the Pandavas were his cousins.
Lord Krishna was involved officially in the Mahabharata when Arjuna and Duryodhana went to Lord Krishna's palace to seek his help.
Lord Krishna told that he would help both of them and gave his options
- Those want him to be on their side, but he wouldn't use any of his weapons.
- And those who want to have his huge narayani sena to be on their side.
Lord Krishna gave his first choice to arjuna as he came first and he sat at lord's feet.
Arjuna chose Lord Krishna to be on his side, in-spite of his assertion that he wouldn't use any weapons and whereas duryodhana got the narayani sena.