The Mahabharata is one of the two major Sanskrit epics of ancient India, the other being the Ramayana.
Not surprisingly, Mahabharata has not merited as much translation as the Ramayana. Most storytellers focus only on a few episodes, those that bring joy, like Bhima killing Bakasura, Drona teaching Arjuna, or Krishna rescuing Draupadi. Modern sanitized versions of the tale edit out the controversial characters like Shikhandi and disturbing stories related to sex. Not good for the children, is the standard excuse. So many generations of Indians have grown up with little knowledge of the true extent of this grand cultural inheritance.
Mahabharata today has 100,000 slokas and is believed to be written by Sage Veda Vyasa, but in reality it was narrated by him and written by Lord Ganesha. When first narrated, it had only 8,800 slokas and Mahabharata original name was Jaya (Jayam) as written by Ganesha.
Then Vyasa’s disciple Vaisampayana narrated this story to King Janamejaya (Pariskshit’s son and Abhimanyu’s grandson) along with additional and elaborated stories. This made it expand to 24,000 slokas and was named Vijaya (Vijayam) and then renamed it as Bharata.
In next generation, Ugrasravas, belonged to the Suta caste, who were typically the bards of Puranic literature, narrated this story to sage Saunaka and other sages in Naimisa forest. The full 100,000 verses of the Mahabharata was completed several centuries later by addition of many stories and was finally named as Mahabharata.
Jaya was about spiritual victory, Vijaya was about material victory, Bharata was the story of a clan and Mahabharata included also the wisdom of the land called Bharat-varsha. What began as an auspicious idea, ended up becoming a massive documentation of realities that frightened the common man.
Bhagavad Gita is one such addition into Mahabharata, which was done during later generations and written according to the conditions of the society that prevailed during those times. It is placed in Mahabharata’s Bhishma Parva with 700 slokas divided between 18 chapters. In the epic Mahabharata, Sanjaya, counsellor of the king Dhritarashtra, after returning from the battlefield to announce the death of Bhisma begins recounting the details of the Mahabharata war. Bhagavad Gita forms the content of this recollection.
Gita begins before the start of the climactic Kurukshetra war, where the Pandava prince Arjuna is filled with doubt on the battlefield. Realizing that his enemies are his own relatives, beloved friends, and revered teachers, he turns to his charioteer and guide, Krishna, for advice. Responding to Arjuna’s confusion and moral dilemma, Krishna explains to Arjuna his duties as a warrior and prince, elaborating on a variety of philosophical concepts.
Why would Krishna leisurely narrate 700 slokas in 18 chapters to Arjuna, when war was just about to begin. It would take him entire day to recite that much of concept and also showing his Viswaroopam (Infinitude) in the end. Would Kaurava army wait for all these preachings to be completed and then start the war? What would both armies be doing when these two were immersed in their own discussions?
Krishna must have simply asked Arjuna to do his duty and leave the result to him and to convince him, he must have shown his Viswaroopam for a minute. This will make Arjuna believe that Krishna is god and has already decided the outcome of this war, for which he is a mere pawn.
It is clearly evident that Gita was written by multiple persons as few intial slokas appear in first person narrative and suddenly it jumps into third person narrtive.
Gajanan Shripat Khair, who researched for 43 years on Bhagavad Gita, concluded in his book Quest for the original Gita that infact it was written by 3 persons over 400 years and that is why narrative lacks continuity.
Also few inclusions like description/creation of caste system, women, sinners and lower castes being treated similarly etc were according to the society in those years.
In later generations, spiritual gurus have included it in PRASTHANA TRAYAM along with Upanishadas and Bramsutras, though it is a brief essence of all Upanishads.
Similarly, Vishnu Sahasranāma is narrated through Bhishma’s character before his death. This Vishnu Sahasranāma is found in the Santi Parva of the Mahabharata is the most popular version of the 1,000 names of Vishnu. Another version exists in the Padma Purana and Matsya Purana. Each name eulogizes one of His countless great attributes.
This also must have been included into Mahabharata from those puranas.
Infact, both Bhagavad Gita and Vishnu Sahasranamam became popular after Adi Sankaracharya wrote commentaries on them in 8th century AD.
The Mahabharata probably reached its final form by the early Gupta period (c. 4th century) when kings ordered complete rewriting of all puranas to preserve them for future generations.
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, many additions were made to it by writers of that generation.