In the Bhagavad-gita Lord Krsna says that He appears to protect His devotees and annihilate the demons. A graphic example of the Lord's protection and annihilation can been seen in His incarnation as Lord Nrsimhadeva, a half-man, half-lion. The following excerpt from the Srimad-Bhagavatam (2.7.14) briefly explains why the Lord appeared in this unusual form.
TRANSLATION: The Personality of Godhead assumed the incarnation of Nrsimhadeva in order to vanquish the great fears of the demigods. He killed the king of the demons [Hiranyakasipu], who challenged the Lord with a club in his hand, by placing the demon on His thighs and piercing him with His nails, rolling His eyebrows in anger and showing His fearful teeth and mouth.
PURPORT: The history of Hiranyakasipu and his great devotee-son Prahlada Maharaja is narrated in the Seventh Canto of Srimad-Bhagavatam. Hiranyakasipu became very powerful by material achievements and thought himself to be immortal by the grace of Brahmaji. Brahmaji declined to award him the benediction of immortality because he himself is not an immortal being. But Hiranyakasipu derived Brahmaji's benediction in a roundabout way, almost equal to becoming an immortal being. Hiranyakasipu was sure that he would not be killed by any man or demigod or by any kind of known weapon, nor would he die in day or night.
The Lord, however, assumed the incarnation of half-man and half-lion, which was beyond the imagination of a materialistic demon like Hiranyakasipu, and thus, keeping pace with the benediction of Brahmaji, the Lord killed him. He killed him on His lap so that he was killed neither on land nor on the water nor in the sky. The demon was pierced by Nrsimha's nails, which were beyond the human weapons imaginable by Hiranyakasipu.
The literal meaning of Hiranyakasipu is one who is after gold and soft bedding, the ultimate aim of all materialistic men. Such demoniac men, who have no relationship with God, gradually become puffed up by material acquisitions and begin to challenge the authority of the Supreme Lord and torture those who are devotees of the Lord. Prahlada Maharaja happened to be the son of Hiranyakasipu, and because the boy was a great devotee, his father tortured him to the best of his ability. In this extreme situation, the Lord assumed the incarnation of Nrsimhadeva, and just to finish the enemy of the demigods, the Lord killed Hiranyakasipu in a manner beyond the demon's imagination. Materialistic plans of godless demons are always frustrated by the all-powerful Lord.