According to the Vishnu purana, there was a demon in treta yuga. He was swift and wise, held knowledge of Vedas and knew almost every celestial weapon. He was very powerful but he did not attack anyone, he did not assault Devtas and he did not molest humans or any other creature.
His name was Dambhodbhava, and he knew one thing for sure, that was immortality. He knew devtas are immortal and he also belong to the same kin, as Suras (Devtas) and Asuras (Demons) both share same father Maharishi Kashyapa. Maharishi had two wives, Diti and Aditi. Diti was mother of Asuras, who were given the loka below ‘bhu-sthal’ or land whereas Suras were born from the womb of Aditi and were given the loka above ‘nabh’ or sky.
There were seven leveled lokas below the bhu-sthal and most significant one is the Paatal Loka. Dambhodbhava was king of every loka beneath the land, but he wanted more for himself. Out of greed he started worshipping Lord Sun.
He performed penance asceticism for several hundred years. He stood on one foot and chanted prayers for Surya Deva for first hundred years. Then he sat on spikes for another thousand years and recited the name of Surya. Then he didn’t stop and again lifted all of his body from ground, abandoned his senses and chanted Surya deva’s name.
He was performing very hard rituals, he was devoted and dedicated and he sacrificed his 2100 years and all his Punyas and energy for his bhakti. Now devta Surya was bound to offer him a boon.
A bright light, ecstatic and white, was visible to Dambhodbhava and there he was, devta Surya standing in front of him. His eyes now glittering with hope and his lips stretched up to a wide smile. He knew he achieved immortality, until the very next moment.
Surya Dev asked him for a boon, he bluntly said he wanted to be immortal. Surya Dev denied, and it made Dambhodbhava infuriated. He questioned and yelled Surya for being unworthy. He asked why he cannot be immortal but his member of kin already is, without any asceticism or sacrifice.
Then Surya Dev tried to convince him to ask for something else, and he finally did ask for something else.
He was wise, and after a moment of deep thought he asked Surya dev to grant him a boon for thousand armors. Armors which shall not be penetrated by but if used divine celestial weapons of Mahavishnu. And whosoever breaks a armor shall die there and then.
Surya Dev knew that this was a very powerful boon to grant, but he was bound to do so. So he did.
Dambhodbhava, who was in wrath for not attaining immortality, became intolerant towards all the creatures and he started to punish every creature. He captured Devtas and all of a sudden their immortality is a curse for them. They cannot die but they feel pain and he was making sure that they do feel some.
All of catastrophe and vandalism was shattering the heart of Mata Murthi, daughter of Daksha and Elder sister of Mata Sati. She and her husband, Dharma, son of Brahma were two great devotees of Mahavishnu and they thought only Mahavishnu can put an end to all this. They went and asked Mahavishnu to do something and stop Dambhodbhava, who is now popularly known as Sahastrakavach with translates to ‘who hold thousand armors’.
Vishnu said he will reincarnate to end this demon, and insisted Mata Murthi to stay safe, be careful and teach her children in Badrinath.
Few years later, Mata Murthi and their husband were blessed with twins. One was named Nara and another Narayan. They both were two bodies with only one soul bifurcated into two parts to follow the purpose, they both knew each other too well and were attached to some deeper level on emotions and what one can feel could also be felt by the other. They were too divine, they were the fourth reincarnation of Shri Mahavishnu on earth to save it from being vandalized by demons, as the story is in the Brahmand Samhita or Vishnu Purana.
For schooling they both were sent to Badrinath gurukul as was directed by Vishnu earlier. After few years of studies, they both attained the knowledge to use and dodge celestial weapons and were also skilled in the knowledge of vedas.
Then they decided one of them will sit and chant Maha Mrityunjaya mantra to also attain the divine grace of lord Shiva, and Narayan said I will sit and chant and he asked Nara to protect him while he shall meditate.
After slipping in deeper meditation of Narayan, Nara observed a great army approaching Badrinath Gurukul to destroy it, and as promised Nara fought it. Then Sahastrakavach came and for 500 years they both fought.
Nara used his divine weapons to successfully break the first armor of Sahastrakavach, but being unaware of the boon over the armor, he dies right at that moment. His death causes pain to Narayan and awakens him from his deep meditation, then with all the Punya he earned while chanting Maha Mrityunjaya mantra for 500 years he blows life in his dead brother and told him now to meditate and Narayan told him that he will kill the Demon.
But after 500 years of war again with sahastrakavach, Narayan cracked an armor and dies, then again Nara awakens and with his punya make Narayan live again. This cycle continuously keeps on going until the very last Armor of Sahastrakavach was left. Now Dambhodbhava knew he can not defeat these two brothers so he started running to seek asylum in the chariot of Lord Surya.
Lord Surya had to provide him asylum he was his devotee, and when Nara and Narayan came, Lord Surya refused to hand him over to him. Then they cursed both of them to reincarnate on earth and live a miserable life, pay for all that they have done.
After hundreds of years passing by in war with Nara and Narayan, Dambhodbhava was old and the Treta yuga was also on the verge of ending. Dambhodbhava dies and in another yuga, Dwapar yuga there are stories of Krishna and Bhishma.
So, Dambhodbhava and Lord Surya both were born as Karna, the good part of Karna was because of Surya Deva and the evil facet was because of demon Dambhodbhava. Nara was Arjuna and Narayan was obviously Shree Krishna, they both shared a soul hence they both knew what the other was thinking or feeling.
The last remaining armor of Dambhodbhava was the one which Karna was wearing at the time he was born and Krishna mischievously had it removed because he told Mata kunti that her all sons shall outlive the war but if Arjuna had pierced the armor, he would have died as per the boon of Lord Surya, and this is also the reason for all the hardships of life of Karna.