The Mahabharata contains the moral principles of the Hindu religion and explores traditional concepts such as duty, action and devotion. The Bhagavad Gita portion of the epic poem represents one of the first written considerations of what constitutes a "just war," and it delves into concepts, such as proportionality in conflict, just means and fair treatment of captives. A primary theme in the Mahabharata is that of moral guidance through philosophical examination.
Consistency in dharma, or righteous action, is another key moral principle examined in the Mahabharata. The epic poem conveys the inverse of the concept "the end justifies the means" to the reader in the example of the negative consequences of a just war won by unjust means. The narratives contained within the Mahabharata demonstrate the relentless and absolute laws of karma, which dictate that each action performed bears relative consequences. They also demonstrate the concept of karma yoga, by which a person pursues a righteous action without attachment to results. Positive results are shown to proceed from actions performed according to the rules of good karma, with the beneficial results shared by all who participated in the righteous efforts that brought them about.
Historians date the Mahabharata's writing as far back as the fourth century B.C., and Hindu tradition states that the sage Vyasa was its author. In its full length, it contains more than 200,000 verses, making it the longest epic poem known. The stories depicted within the Mahabharata are thought to have originated during the 8th and 9th centuries B.C.