Lord Sri Krishna is the supreme personality of godhead who appears every 4 billion years in his original form in the Dwapara yuga which is followed by Kaliyuga and in other dwapara yugas, one of his quadruple expansions appear as Krishna.
Krishna is the resident of the transcendental planet Goloka Vrindavan which is the topmost spiritual abode, full of madhurya rasa or sweet amorous pastimes of the lord with his most beloved gopis, headed by Srimati Radharani.
vinasaya ca duskrtam
sambhavami yuge yuge
Whenever and wherever there is a decline in religious practice, O descendant of Bharata, and a predominant rise of irreligion-at that time I descend Myself.In order to deliver the pious and to annihilate the miscreants, as well as to reestablish the principles of religion, I advent Myself millennium after millennium.
In order to protect his dear devotees and annihilate the miscreants, the supreme lord comes to this material world with his angas (Main agents), upangas (Sub agents), astra (Weapons) and parshadas (His dear associates).
The supreme lord is most merciful and beneficial and hence, has no one as his enemy. Being the supreme father of everyone, he doesn’t think of anyone’s ill. The vedanta sutra says that he neither hates anyone nor loves anyone, but he is inclined towards people obedient to him. Just like a father who has many children he is equal to everyone but he is specially inclined to his obedient sons.
Therefore, those who are the enemies of the lord, he awards them with liberation, what to speak of the ones who have dedicated their lives in the service of the lord. At the end, he is the ultimate well-wisher of everyone.
As per Bhagwad Gita (5,29), The sages, knowing Me as the ultimate purpose of all sacrifices and austerities, the Supreme Lord of all planets and demigods and the benefactor and well-wisher of all living entities, attain peace from the pangs of material miseries. therefore, it becomes a well established fact that Krishna is never enemy of anyone.
The story of Mahabharata is basically his causeless mercy for the dull headed ones, who need stories and climax to understand the deeper aspects of philosophy. Lord Krishna, who was also known as Vaasudev i.e. the son of Vasudeva and Devaki and fostered by Nanda Maharaj and Yashoda. He appeared in the clan of Yadus, the chandravanshis.
The Yadu clan was a kshatriya clan and hence, Krishna along with his elder brother Balarama fought valiantly with all the asuras and demons who tried to harm the brajwasis, the devotees completely dependent on Krishna.
In the context of Mahabharata, the lord was specially favourable for the Pandavas, who were devoted to him and had special corner of affection for Arjuna. He was the guide for him and the other Pandavas and guided them throughout the battle.
He became a messenger, a shanti doot of the Pandavas and asked for a peace treaty to which Duuryodhana blatantly refused and said, I shall not spare a piece of land, which has an area equal to the tip of a pin and hence, instigated the fight for the same.
Actually, this pastime of the lord is just for the conditioned souls to understand that those who are surrendered to the Lord, he delivers and protects them to the best of his capacity.
The example of Draupadi shows that when one tries to save himself by his own caliber, he is never successful but when one completely depends upon the lord, then the lord takes full charge of him and thereby, he never allows his devotee to perish.
A very beautiful prayer by Kunti maharani states the mood of his devotees.(SB 1.8.24-25)
vipadaḥ santu tāḥ śaśvat
tatra tatra jagad-guro
bhavato darśanaṁ yat syād
My dear Kṛṣṇa, Your Lordship has protected us from a poisoned cake, from a great fire, from cannibals, from the vicious assembly, from sufferings during our exile in the forest and from the battle where great generals fought. And now You have saved us from the weapon of Aśvatthāmā. I wish that all those calamities would happen again and again so that we could see You again and again, for seeing You means that we will no longer see repeated births and deaths.