Dhritarashtra and Pandu were brothers. Dhritarashtra married Gandhari, and Pandu was married to Kunti and Madri. King Pandu was cursed for a sin while hunting, due to which he was not permitted to unite with his wife. Kunti got a boon through her sincere service of a wise sage in her younger age, and she begot three children, namely, Yudhisthira, Bhima and Arjuna from Yama, Vayu and Indra respectively. Madri had twins, Nakula and Sahadeva, through the celestial physicians called Asvini-Devatas. Dhritarashtra had a hundred and one children by his wife Gandhari. Pandu passed away and his sons, the Pandavas, were all brought up by Dhritarashtra along with his sons known as Kauravas. The Pandavas and Kauravas grew up together, but due to the braveness and intelligence of the former, the Kauravas were unable to tolerate them. Hence the Pandavas decided to live separately, sharing half of their kingdom.
The Pandavas' pomp, wealth and glory displayed during the Rajasuya Yajna aroused deep jealousy and greed in the mind of Duryodhana, the chief of the Kauravas, who, with the cunning advice of his uncle, Sakuni, invited Yudhisthira to a game of dice and fraudulently defeated him, whereby all his wealth and possessions, including Draupadi, were lost. Finally it was settled that the Pandavas, including Draupadi, should repair to the forest for twelve years in exile, after which they had to live incognito for another year, untraced by the Kauravas. During this period the kingdom was to be ruled by the wicked Duryodhana.
Having successfully completed these thirteen years of exile, facing many obstacles and dangers instigated by the Kauravas, the Pandavas, as per the terms of the agreement, approached the Kauravas for their share of the kingdom. Duryodhana, however, flatly refused to part with as much land as could be covered by the point of a needle. According to the advice of Mother Kunti and with the inspiration of Lord Krishna, the Pandavas decided upon war and tried to establish their rightful claim on the kingdom by overcoming the Kauravas.
Duryodhana and Arjuna, from the side of the Kauravas and Pandavas respectively, were sent to Dwaraka to seek the help of the Yadava hero, Lord Krishna, in the battle. They both found Krishna resting on a couch in His palace. Duryodhana went in and occupied a seat at the head of the couch while Arjuna stood near the feet of the Lord. The moment Sri Krishna opened His eyes, He naturally saw Arjuna first, and then Duryodhana sitting on a chair. After enquiry of their welfare and the purpose of their visit, Sri Krishna, according to the prevailing custom, gave the first choice to Arjuna, because of his age, and also because of His sight of Arjuna first. Krishna asked Arjuna to fulfil his desire by selecting Him unarmed or His powerful army called Narayani Sena. Arjuna, who was a devotee of Sri Krishna, expressed his desire to have the Lord with him, neglecting the powerful Narayani Sena, even though Krishna warned that He would remain a witness, bound by the vow of not participating in battle and not taking up arms. Duryodhana, with great delight, thinking that Arjuna was foolish, expressed his wish for the powerful army to help his side in the battle.
When Krishna asked Arjuna why he chose Him when He was not for taking up arms, Arjuna said, "O Lord! You have the power to destroy all the forces by a mere sight. Why then should I prefer that worthless army? I have for a long time been cherishing a desire in my heart that you should act as my charioteer. Kindly fulfil my desire in this war".The Lord, who is ever the most devoted lover of His devotees, accepted his request with pleasure; and thus Krishna became the charioteer of Arjuna in the battle of the Mahabharata.
After the return of Duryodhana and Arjuna from Dwaraka, Lord Krishna Himself went once to Hastinapura as the emissary of the Pandavas and tried to prevent the war. But then, under the guidance of Sakuni, the egoistic Duryodhana refused to agree to the peace mission and tried to imprison Lord Krishna, at which Krishna showed His Supreme Form (Viswarupa). Even the blind Dhritarashtra saw it by the Lord's Grace. King Dhritarashtra, due to his attachment to his sons, failed to control them, and the Kaurava chief, Duryodhana, with vain hope, decided to meet the powerful Pandavas in war.
When both sides were prepared to commence the battle, the sage Veda Vyasa approached blind Dhritarashtra and said, "If you wish to see this terrible carnage with your own eyes I can give you the gift of vision." The Kaurava king replied, "O Chief of the Brahmarishis! I have no desire to see with my own eyes this slaughter of my family, but I should like to hear all the details of the battle."
Then the sage conferred the gift of divine vision on Sanjaya, the trusty counsellor of the king, and told the king, "Sanjaya will describe to you all the incidents of the war. Whatever happens in the course of the war, he will directly see, hear or otherwise come to know. Whether an incident takes place before his eyes or behind his back, during the day or during the night, privately or in public, and whether it is reduced to actual action or appears only in thought, it will not remain hidden from his view. He will come to know everything, exactly as it happens. No weapon will touch his body nor will he feel tired."
After the ten days of continued war between the Pandavas and the Kauravas, when the great warrior Bhishma was thrown down from his chariot by Arjuna, Sanjaya announces the news to Dhritarashtra. In agony the king asks Sanjaya to narrate the full details of the previous ten days war, from the very beginning, in all detail as it happened. Here commences the Bhagavad Gita.