"For example, although Lord Brahma appeared from the lotus seat that had grown from the abdomen of Garbhodakasayi Visnu, he could not understand what to do after his appearance. He was attacked by two demons, Madhu and Kaitabha, who took away Vedic knowledge, but the Lord killed them and entrusted to Lord Brahma the Vedic knowledge. Thus the Lord appears in every millennium in the societies of demigods, human beings, animals, saints and aquatics. All such incarnations are meant to protect the devotees and kill the demons, but this killing and protecting does not reflect any sense of partiality on the part of the Supreme Lord. The conditioned soul is always attracted by the external energy. Therefore he is subjected to lust and greed, and he suffers under the conditions of material nature. The Lord's causeless mercy toward His devotee is the only means by which to get out of material existence. Anyone engaged in glorifying the Lord's activities is always unafraid of this material world, whereas one who cannot glorify the Lord in that way is subjected to all lamentation."
Srimad-Bhagavatam 7:9 Summary
"My dear Lord, when You appeared as Hayagriva, with the head of a horse, You killed two demons known as Madhu and Kaitabha, who were full of the modes of passion and ignorance. Then You delivered the Vedic knowledge to Lord Brahma. For this reason, all the great saints accept Your forms as transcendental, untinged by material qualities.
Purport: The Supreme Personality of Godhead in His transcendental form is always ready to give protection to His devotees. As mentioned herein, the Lord in the form of Hayagriva killed two demons named Madhu and Kaitabha when they attacked Lord Brahma. Modern demons think that there was no life in the beginning of creation, but from Srimad-Bhagavatam we understand that the first living creature created by the Supreme Personality of Godhead was Lord Brahma, who is full of Vedic understanding. Unfortunately, those entrusted with distributing Vedic knowledge, such as the devotees engaged in spreading Krsna consciousness, may sometimes be attacked by demons, but they must rest assured that demoniac attacks will not be able to harm them, for the Lord is always prepared to give them protection."
"When the demons Madhu and Kaitabha were killed by the Supreme Personality of Godhead, their kinsmen also observed the ritualistic ceremonies so that these demons could return home, back to Godhead."
Srimad-Bhagavatam 7:10:22 Purport
Bhaktivedanta Book Trust. Excerpted from texts and purports of HDG A.C. Bhaktivedanta Swami Srila Prabhupada.