Veda is divided into four major parts viz, Samhitas (prayers), Brahmanas (rituals), Aranyakas ( meditations) and Upanishads (The knowledge of self). The first three (Samhita, Brahmana & Aranyaka) are collectively called as Veda Purva (Starting) and the last one Upanishad is called as Veda Anta (ending) or Vedanta. The Veda Purva is also referred as Karma Kanda (Portion dealing with Rituals & Activities) and Vedanta as Jnana Kanda (Portion dealing with The Knowledge of Supreme Self).
The Mahabharata and Srimad Valmiki Ramayaṇa are the two celebrated epics or Itihasas of India. The word Itihasa is derived from the combination iti+ha+asam meaning “it happened thus”. Itihasa is therefore a story of something that happened in the past.
Although branded as mythologies or stories along with Puraṇas, these two great epics are much more than that. As they have been a part and parcel of Indian culture for thousands of years and more, so they have shaped the thought and behavioral patterns of Indian people for thousands of years. There is not a sphere in Indian cultural milieu that has been left untouched by these two great works.
Mahabharata itself claims [adiparva 2.83] that Mahaṛṣi Vyasa composed the epic as a great Dharma Śastra [code of conduct for proper living], as Artha Śastra [on politics and governance], Mokṣa Śastra [science of liberation] and also as Kama Śastra [erotics]. Its greatness can be gauged from the fact that it is regarded as the Fifth Veda. Towards the end, the epic claims that what is said in it would be found elsewhere and what is not considered in it would not be found anywhere else.
It is Mahabharata that has given to the world Bhagavad Gita and Vishnu Sahasranama among other jewels. It is an understatement to merely say that most of the later works in Hindu Philosophy and other sciences were influenced by what is contained in this great epic.
All the works on grammar, etymology, euphony, fine arts, mythologies, codes of conduct in society, renunciation, devotion and worship, logic, various sciences, warfare, politics, economics, sex, liberation, etc. that came into existence in the last 2500 years have great amount of what has been deliberated in Mahabharata. No wonder then this epic has shaped the culture of such a huge country.
While Mahabharata has led people on the path of righteousness through various philosophies, a large number of stories and the theological literature contained in it, the Ramayaṇa is the story of Lord Rama, His descent in this world, His life and His exploits. If Mahabharata can be likened to a huge palace with hundreds of windows through which a variety of things can be observed, Ramayaṇa is like a palace with one window through which also the same things are observed and enjoyed.
Like the other epic, Ramayaṇa also deals with the subjects listed above and through the life of Lord Rama and how He lived His life, it has guided people of India for thousands of years on the path of righteousness and liberation. Life of Rama shows to us how to lead a life of Dharma even in the most trying times and what such a Dharmic life can bestow upon an individual. These two great epics are perceived as eyes of Indian people.
The main purpose of the epics is to present the higher philosophical truths in the form of stories to lay people. It is akin to Puraṇas in that. However, while Puraṇas need not have any direct relation to reality or give historical account of one or more persons, often Itihasas are stories based on one or more historical accounts.
On the above count, both the Ramayaṇa and the Mahabharata serve the purpose. However, over the period of thousands of years, several versions or even recensions have crept in, especially in the case of Ramayaṇa. There are hundreds of Ramayaṇas even within India and more across the world. Some of them even have juxtaposed the protagonists of the tale. However, at the end of the day all of them invariably serve the purpose of delivering higher truths in an easily understandable form to one and all. In the case of Mahabharata, three versions, namely, Bengal version, Lahore version and Southern version are deemed authentic, though a few more are also on the vogue with minor variations.
There are shorter versions of these Epics with some narrating the entire tale in just one shloka, like Eka Shloki Ramayaṇa or in 100 shlokas, like Shata Shloki Ramayaṇa. Same goes with Mahabharata too.
The main difference between these two Epics in deriving the philosophies and righteous principles of the great teachers and traditions lies in the contents themselves. While Ramayaṇa deals with the story of Lord Rama as a King of Ayodhya, Mahabharata has a wider canvass even though it is supposedly limited to the lives of Pandavas and Kauravas. Because of its narrow focus, Ramayaṇa does not shed much light on the customs, life style, philosophies of Ayodhya during Rama’s life. On the other hand, Mahabharata is a goldmine containing numerous anecdotes, stories and philosophical treatises in itself. On that count, Mahabharata throws more light on social practices, customs and philosophies of the day, not only of the landscape of the story but also of entire India.