Karna was a demon by name Dambhodbhav in his previous birth . Dambodbhav did penace to Sun for many years . Pleased with his penace Sun appeared before him and asked him to partake a boon . Dambodbhav asked for immortality . Sun said no one can become immortal as all those who have taken birth should die , this the law of the nature set by NARAYANA , thus he can ask for something else .
Dambodbhav asked something that would be akin to immortality . HE asked ” Oh Lord Sun kindly give me a 1000 KAvach – Kundal that should not break for atleast 1000 years and one who breaks it should die immediately . ” Sun grants him the boon .
Dambodbhav smitten with pride created havoc in the world and none could kill Dambodbhav and none dared to fight as that would mean definite death . SO when the world was besieged with the cruelty of Dambodbhav , sages and devatas went to Lord NArayana asked for the relief .
Lord Narayana took the form of two sages along with NARA . NARA-NARAYANA . The sages confronted the Demon , Narayana sat in meditation tapasya, for a 1000 years with mrit sanjeevani vidya , while nara would fight with Dambhodbhav , after 1000 years Nara would break the kavach and die , NArayana would bring him back to life and continue the fight , nara would comlete the tapasya for 1000 years as Narayana fought the battle and break another kavach , thus each would alternatively fight and practise tapasya and cut the kavach . This continued for 999 times in 1000000 years . The fight went on for 1000000 years . and when the last Kavach was left , Dambhodbhav fled the battle field and hid behind SUN in surya mandal , Sun gave him shelter . Nara Narayana demanded the demon to be handed over but SUn pleaded on behalf of him . Thus Nara cursed SUn to be born along with the demon and be killed .
For having given shelter to Demon and going against NArayana , Sun took the birth as KARNA along with suryavarman demon [ Dambhodbhav] . This time he was born with the 1000th kavach kundal naturally by the grace oF previous boon by SUN .
Nara and NARAYANA were born again as Arjun and Krishna .
This kavach whoever breaks it would die and hence , had to be begged back by Indra . As demon would not give it Karna had SUN also born in this birth as Amsa . With the quality of giving dana readily , SUN gave back the KAVACH he had been tricked to offer by DAMBHODBHAV , and created havoc in the world . Thus Indra tricked Dambhodbhav and SUn rectified his mistake .
The presence of Dambhodbhav and Narkasur in the KArna made him undergo untold misery and misfortunes . But his previous tapasya and presence of SUN made him a hero as well . Apart from that due to immense devotion that Sugreeeva had done in Ramayana , Krishna himself Manifested in KARNA to make him unparalleled due to PArshuram’s chariot and Bhargava astra . WHenever the whole Pandava ARMY trembled on account of KARNA , it was actually Krishna in him that made the balance in the WAR . At all such times , Karna won and became difficult to conquer like swayamvar of Jarasandha’s daughter , use of Bhargav astra , use of shakti, use of Bramhastra , riding Chariot of Parshuram etc.
As with KAvach on HAd Arjun killed Karna , even Arjun would have lost his Life , just like previous birth fight . Thus Kavach was taken away and returned to Suryaloka . Now Sun had to be released from runanubandha of INdra , on account of shelter to demon and also on account of killing VALI .
Thus he was killed unarmed to set right the score and make way for sun to go back to Surya Loka and NARA NARAYANA to return to NARAYANAASHRAMA in upper BAdri .