The epic is traditionally ascribed to the sage Vyāsa, who is also a major character in the epic. Vyāsa described it as being itihāsa (history). He also describes the Guru-shishya parampara, which traces all great teachers and their students of the Vedic times.
The first section of the Mahābhārata states that it was Gaṇeśa who wrote down the text to Vyasa's dictation.
The epic employs the story within a story structure, otherwise known as frametales, popular in many Indian religious and non-religious works. It is first recited at Takshashila by the sage Vaiśampāyana, a disciple of Vyāsa, to the King Janamejaya who is the great-grandson of the Pāṇḍava prince Arjuna. The story is then recited again by a professional storyteller named Ugraśrava Sauti, many years later, to an assemblage of sages performing the 12-year sacrifice for the king Saunaka Kulapati in the Naimiśa Forest.
The text was described by some early 20th-century western Indologists as unstructured and chaotic. Hermann Oldenberg supposed that the original poem must once have carried an immense "tragic force" but dismissed the full text as a "horrible chaos." Moritz Winternitz (Geschichte der indischen Literatur 1909) considered that "only unpoetical theologists and clumsy scribes" could have lumped the parts of disparate origin into an unordered whole.
Accretion and redaction
Research on the Mahābhārata has put an enormous effort into recognizing and dating layers within the text. Some elements of the present Mahābhārata can be traced back to Vedic times. The background to the Mahābhārata suggests the origin of the epic occurs "after the very early Vedic period" and before "the first Indian 'empire' was to rise in the third century B.C." That this is "a date not too far removed from the 8th or 9th century B.C." is likely. Mahābhārata started as an orally-transmitted tale of the charioteer bards. It is generally agreed that "Unlike the Vedas, which have to be preserved letter-perfect, the epic was a popular work whose reciters would inevitably conform to changes in language and style," so the earliest 'surviving' components of this dynamic text are believed to be no older than the earliest 'external' references we have to the epic, which may include an allusion in Panini's 4th century BCE grammar Aṣṭādhyāyī 4:2:56. It is estimated that the Sanskrit text probably reached something of a "final form" by the early Gupta period (about the 4th century CE). Vishnu Sukthankar, editor of the first great critical edition of the Mahābhārata, commented: "It is useless to think of reconstructing a fluid text in a literally original shape, on the basis of an archetype and a stemma codicum. What then is possible? Our objective can only be to reconstruct the oldest form of the text which it is possible to reach on the basis of the manuscript material available." That manuscript evidence is somewhat late, given its material composition and the climate of India, but it is very extensive.
The Mahābhārata itself (1.1.61) distinguishes a core portion of 24,000 verses: the Bhārata proper, as opposed to additional secondary material, while the Aśvalāyana Gṛhyasūtra (3.4.4) makes a similar distinction. At least three redactions of the text are commonly recognized: Jaya (Victory) with 8,800 verses attributed to Vyāsa, Bhārata with 24,000 verses as recited by Vaiśampāyana, and finally the Mahābhārata as recited by Ugraśrava Sauti with over 100,000 verses. However, some scholars, such as John Brockington, argue that Jaya and Bharata refer to the same text, and ascribe the theory of Jaya with 8,800 verses to a misreading of a verse in Ādiparvan (1.1.81). The redaction of this large body of text was carried out after formal principles, emphasizing the numbers 18 and 12. The addition of the latest parts may be dated by the absence of the Anuśāsana-parva and the Virāta parva from the "Spitzer manuscript". The oldest surviving Sanskrit text dates to the Kushan Period (200 CE).
According to what one character says at Mbh. 1.1.50, there were three versions of the epic, beginning with Manu (1.1.27), Astika (1.3, sub-parva 5) or Vasu (1.57), respectively. These versions would correspond to the addition of one and then another 'frame' settings of dialogues. The Vasu version would omit the frame settings and begin with the account of the birth of Vyasa. The astika version would add the sarpasattra and aśvamedha material from Brahmanical literature, introduce the name Mahābhārata, and identify Vyāsa as the work's author. The redactors of these additions were probably Pāñcarātrin scholars who according to Oberlies (1998) likely retained control over the text until its final redaction. Mention of the Huna in the Bhīṣma-parva however appears to imply that this parva may have been edited around the 4th century.
The Ādi-parva includes the snake sacrifice (sarpasattra) of Janamejaya, explaining its motivation, detailing why all snakes in existence were intended to be destroyed, and why in spite of this, there are still snakes in existence. This sarpasattra material was often considered an independent tale added to a version of the Mahābhārata by "thematic attraction" (Minkowski 1991), and considered to have a particularly close connection to Vedic (Brahmana) literature. The Pañcavimśa Brahmana (at 25.15.3) enumerates the officiant priests of a sarpasattra among whom the names Dhṛtarāṣtra and Janamejaya, two main characters of the Mahābhārata's sarpasattra, as well as Takṣaka, the name of a snake in the Mahābhārata, occur.
The Suparṇākhyāna, a late Vedic period poem considered to be among the "earliest traces of epic poetry in India," is an older, shorter precursor to the expanded legend of Garuda that is included in the Āstīka Parva, within the Ādi Parva of the Mahābhārata.
The earliest known references to the Mahābhārata and its core Bhārata date to the Aṣṭādhyāyī (sutra 6.2.38) of Pāṇini (fl. 4th century BCE) and in the Aśvalāyana Gṛhyasūtra (3.4.4). This may mean the core 24,000 verses, known as the Bhārata, as well as an early version of the extended Mahābhārata, were composed by the 4th century BCE. A report by the Greek writer Dio Chrysostom (c. 40 - c. 120 CE) about Homer's poetry being sung even in India seems to imply that the Iliad had been translated into Sanskrit. However, Indian scholars have, in general, taken this as evidence for the existence of a Mahābhārata at this date, whose episodes Dio or his sources identify with the story of the Iliad.
Several stories within the Mahābhārata took on separate identities of their own in Classical Sanskrit literature. For instance, Abhijñānaśākuntala by the renowned Sanskrit poet Kālidāsa (c. 400 CE), believed to have lived in the era of the Gupta dynasty, is based on a story that is the precursor to the Mahābhārata. Urubhaṅga, a Sanskrit play written by Bhāsa who is believed to have lived before Kālidāsa, is based on the slaying of Duryodhana by the splitting of his thighs by Bhīma.
The copper-plate inscription of the Maharaja Sharvanatha (533–534 CE) from Khoh (Satna District, Madhya Pradesh) describes the Mahābhārata as a "collection of 100,000 verses" (śata-sahasri saṃhitā).
The 18 parvas or books
The division into 18 parvas is as follows:
|1||Adi Parva (The Book of the Beginning)||1–19||How the Mahābhārata came to be narrated by Sauti to the assembled rishis at Naimisharanya, after having been recited at the sarpasattra of Janamejaya by Vaishampayana at Takṣaśilā, modern-day Taxila, Pakistan. The history and genealogy of the Bharata and Bhrigu races is recalled, as is the birth and early life of the Kuru princes (adi means first).|
|2||Sabha Parva (The Book of the Assembly Hall)||20–28||Maya Danava erects the palace and court (sabha), at Indraprastha. Life at the court, Yudhishthira's Rajasuya Yajna, the game of dice, the disrobing of Pandava wife Draupadi and eventual exile of the Pandavas.|
|3||Vana Parva also Aranyaka-parva, Aranya-parva (The Book of the Forest)||29–44||The twelve years of exile in the forest (aranya).|
|4||Virata Parva (The Book of Virata)||45–48||The year spent incognito at the court of Virata.|
|5||Udyoga Parva (The Book of the Effort)||49–59||Preparations for war and efforts to bring about peace between the Kaurava and the Pandava sides which eventually fail (udyoga means effort or work).|
|6||Bhishma Parva (The Book of Bhishma)||60–64||The first part of the great battle, with Bhishma as commander for the Kaurava and his fall on the bed of arrows. (Includes the Bhagavad Gita in chapters 25–42.)|
|7||Drona Parva (The Book of Drona)||65–72||The battle continues, with Drona as commander. This is the major book of the war. Most of the great warriors on both sides are dead by the end of this book.|
|8||Karna Parva (The Book of Karna)||73||The continuation of the battle with Karna as commander of the Kaurava forces.|
|9||Shalya Parva (The Book of Shalya)||74–77||The last day of the battle, with Shalya as commander. Also told in detail, is the pilgrimage of Balarama to the fords of the river Saraswati and the mace fight between Bhima and Duryodhana which ends the war, since Bhima kills Duryodhana by smashing him on the thighs with a mace.|
|10||Sauptika Parva (The Book of the Sleeping Warriors)||78–80||Ashvattama, Kripa and Kritavarma kill the remaining Pandava army in their sleep. Only 7 warriors remain on the Pandava side and 3 on the Kaurava side.|
|11||Stri Parva (The Book of the Women)||81–85||Gandhari and the women (stri) of the Kauravas and Pandavas lament the dead and Gandhari cursing Krishna for the massive destruction and the extermination of the Kaurava.|
|12||Shanti Parva (The Book of Peace)||86–88||The crowning of Yudhishthira as king of Hastinapura, and instructions from Bhishma for the newly anointed king on society, economics and politics. This is the longest book of the Mahabharata. Kisari Mohan Ganguli considers this Parva as a later interpolation.'|
|13||Anushasana Parva (The Book of the Instructions)||89–90||The final instructions (anushasana) from Bhishma.|
|14||Ashvamedhika Parva (The Book of the Horse Sacrifice)||91–92||The royal ceremony of the Ashvamedha (Horse sacrifice) conducted by Yudhishthira. The world conquest by Arjuna. The Anugita is told by Krishna to Arjuna.|
|15||Ashramavasika Parva (The Book of the Hermitage)||93–95||The eventual deaths of Dhritarashtra, Gandhari and Kunti in a forest fire when they are living in a hermitage in the Himalayas. Vidura predeceases them and Sanjaya on Dhritarashtra's bidding goes to live in the higher Himalayas.|
|16||Mausala Parva (The Book of the Clubs)||96||The materialisation of Gandhari's curse, i.e., the infighting between the Yadavas with maces (mausala) and the eventual destruction of the Yadavas.|
|17||Mahaprasthanika Parva (The Book of the Great Journey)||97||The great journey of Yudhishthira, his brothers and his wife Draupadi across the whole country and finally their ascent of the great Himalayas where each Pandava falls except for Yudhishthira.|
|18||Svargarohana Parva (The Book of the Ascent to Heaven)||98||Yudhishthira's final test and the return of the Pandavas to the spiritual world (svarga).|
|khila||Harivamsa Parva (The Book of the Genealogy of Hari)||99–100||This is an addendum to the 18 books, and covers those parts of the life of Krishna which is not covered in the 18 parvas of the Mahabharata.|