The Mahabharata, like the Jewish Bible, is a collection of many different stories around one central story. The central story is this:
The five good Pandava brothers fight with their cousins, the hundred bad Kaurava brothers, to see who will rule the cities of the upper Ganges river and the Jumna river (in north-western India). And in the end, with the help of many Hindu gods and especially Krishna, the Pandavas win.
But the story has thousands of pages, and tells many other stories about the characters. One part is the earliest known version of the Cinderella story. Another important part of the Mahabharata is the Bhagavad Gita, which is a kind of speech about how to be good that has had a lot of influence on Indian thought.
The Mahabharata more or less tells the story of Vedic conquests in India around 1000-800 BC. It was probably first composed around 500 BC and then written down around 300 BC, in Sanskrit, not long after people in India first started using the alphabet. That’s not long after when people first wrote down the Jewish Bible. It would be in the time of the Mauryan Empire.
In the Mahabharata, the gods are always on the side of the Vedic Pandava brothers, and never help the bad Kauravas. The bad guys, in fact, are often represented as snake-people. (Compare the Greek story of Perseus and Medusa, from about the same time). Nevertheless, stories of heroism and frie ndship, like the story of Karna and Duryodhana, are told about the Kauravas too.
This is the Vedic view of things – the Harappan or Dravidian people who lived in India would have taken a very different view of who was good and who was bad. The Vedic people, after all, were invading the Dravidians’ country and taking it over. But the Vedic people won the war, and so their version of the story also won.