The Mahabharata is one of the two major Sanskrit epics of ancient India, the other being the Ramayana. It is a story of a great war between two branches of a royal family, the Kauravas and the Pandavas. The epic explores the themes of dharma, karma, and the cycle of rebirth.

The story begins with King Shantanu falling in love with a beautiful woman named Ganga. She agrees to marry him on the condition that he never questions her actions. Ganga gives birth to a son, but then drowns him in the river. This happens seven times, and on the eighth time, Shantanu questions her actions and she leaves him.

Years later, Shantanu meets and falls in love with Satyavati, a fisherwoman. Her father agrees to let her marry Shantanu on the condition that any sons they have will inherit the throne. Satyavati gives birth to two sons, Chitrangada and Vichitravirya. Chitrangada is killed in battle, and Vichitravirya is too young to rule, so Satyavati arranges for her son's widows, Ambika and Ambalika, to marry the sage Vyasa and bear him children.

Ambika and Ambalika give birth to Dhritarashtra and Pandu, respectively. Dhritarashtra is born blind, so Pandu is made king. Pandu marries Kunti and Madri, and they have five sons between them, known as the Pandavas. Dhritarashtra has one hundred sons, known as the Kauravas.

The Pandavas are skilled in archery and other arts, and they become rivals with the Kauravas. Duryodhana, the eldest Kaurava, is jealous of the Pandavas and plots against them. He challenges Yudhishthira, the eldest Pandava, to a game of dice, and Yudhishthira loses everything, including his kingdom and his brothers' freedom. The Pandavas are exiled for 13 years.

During their exile, the Pandavas have many adventures and meet many sages, including Krishna. Arjuna, the third Pandava, falls in love with Draupadi, the princess of Panchala, and they get married. When the Pandavas return from exile, they demand that their kingdom be returned to them, but Duryodhana refuses. This leads to the great war of Kurukshetra.

The war lasts for eighteen days and is fought between the Kauravas and the Pandavas. Many heroes on both sides are killed, including Bhishma, Drona, and Karna. On the eighteenth day, Duryodhana is killed by Bhima, the second Pandava. The Pandavas regained their kingdom and ruled wisely for many years.

The Mahabharata also contains many sub-stories and philosophical teachings, including the Bhagavad Gita, which is a dialogue between Krishna and Arjuna about dharma and karma.