-This supplements the previous answers:
-This information i got from Srivaishnavism blog spot
The avatara of Hayagriva Bhagavan took place to restore the Vedas to Brahma. Lord Vishnu/Narayana had taught BrahmA the Creation through His breath of VedAs. Then, Brahma could understand how various kalpams had begun due to Lord’s grace. Brahma became extremely proud and head strong of his position as the creator and about his powers. Lord Narayana as usual wanted to teach him a lesson and decided to remove Brahma's pride. A couple of water droplets from the lotus seat of the Lord incarnated as two Asuras, Madhu and Kaitabha; kaitabha was of thamO guNA and the other (madhu) was of rajO guNA.
They stole the Vedas from Brahma. Lord Vishnu smiled.
Unable to carry on his work of creation without the Vedas, Brahma rushed to the Lord and pleaded Lord Narayana for mercy and saving Vedas. BrahmA prostrated to the Lord and said:
"Vedas alone are my eyes; they are my wealth; They are my Lord. The whole world is surrounded by darkness due to the absence of Vedas. How am I to proceed on my creation without the Vedas ? Please arise from the Yoga nithrA and help me Lord! Please give me back my eyes which have been blinded by my own pride."
"veda: mE paramam sakshI: veda: mE paramam paramveda: mE paramam dharma, veda: mE brahma sOtthamam"
Lord Narayana incarnated as Hayagriva, appeared as the white Horse faced, faultless sphatika hued form, sattva form, with Divya tEjas, and lustrous form and destroyed the Asuras and restored the Vedas to Brahma.
With a lovely long nose, like the heaven surrounded by white bright stars, the asva siras (head of horse) illumined the whole world. The upper world and the lower world became His ears. The rays of Sun's brightest lustres are His hairs at the nape of His neck (pidari). BhUmi became His forhead; Ganga and Saraswathi became two lovely eyebrows; Chandra Sooryar (The Moon and the Sun) became His two eyes; SandhyA dEvathai became His nostrils; Pithru devathAs became His teeth; GolOkam and Brahma lOkam became His two lips; kalaraathri became His neck; The Divya tEjas Sathva form Sri Hayagreevan thus, in a grandest beautiful manner appeared. He rushed to PaathaaLa lOkam and raised His "uthGitha" in samavEdha swara and terrified Madhukaitabha asurAs; They hid the VedhAs (which were in the form of babies) and ran away from the scene.
Lord Hayagreeva handed over the Vedas to BrahmA and went back. Madhukaitabha searched for the sound which terrified them earlier but found the Vedas missing. They rushed to BrahmA who in turn was terribly scared and sought the help of Lord Narayanan, again. Lord Hayagreeva fought with asurAs and killed them. BrahmA continued his work of creation.
This avataara is described in VishNu puraaNam as "mathsya kUrma varaaha ashva simha rUpaathibhi:".
-In BrahmANda purANam Purana
During maheshwara-naradha samvaadham, Naradha describes this avthaar. Even when naradha praises Sri ranga kshetra in this PurANam, he says "ashva sirasE namah:". That is why the Lord is called Madhusoodhanan. (for having killed madhu and kaitabha).
In MahAbharatham: Shanthi parvam, hayasira upaakhyaanam details Hayagreeva avathaara. Srimad Bhagawatham, too, describes Hayagreeva avtaara.
There is another version of this avtaar and killing of asurAs. When paraLaya was about to end, Lord Vishnu out of His dirt from the ear drum made two small solid balls and dropped on the Lotus leaf and BrahmA activated the PrANa vaayu, which gave life to these two, as madhu and kaitabha. These asurAs appeared and grew up.
BrahmA started off his creation and Vedhas were snatched away by these two asurAs. When the most compassionate Lord Vishnu, then wished to please the asurAs, without killing them, asked them as to what they want as a boon. These two asurAs said "we can give You what You want". That is it! The Lord decided to kill them. They said "Can You kill us only where there is no cover for the sky?". The Lord immediately took Hayagreeva avtaara and removed His cloth on the Thighs, put them on His thighs and killed them. Lord’s legs house the Earth and the space/sky. Since the Lord removed the cloth from His thighs and killed them, He still complied with what they challenged Him. What they thought was impossible to happen, He could make it happen with no effort. Lord Hayagreeva, thus saved the Vedas and the world.
The moral is: thamas, rajas guNAs are to be destroyed to reach Him.
-There is yet another interesting "different" version in BrahmANda PuraaNam and Sri Devi Bhagawatham.
There was a asurA, by name Hayagreeva (with horse face) who did his severe penance/ tapas on Parvathi Devi. Parvathi, pleased with his tapas, appeared in his front and the asurA asked for "no death". She said "Impossible-cannot be granted". Then the asurA amended the request and said "Except for a horse faced one, no one else can kill me". (thinking, that it can never happen!). She consented. He became tremendously proud of his achievement and started harassing every deva and rishi. He troubles all three worlds. He snatched away the Vedas from BrahmA and disappeared. The Lord appeared as Hayagreeva and killed the asurA to save the world and bring back the Vedas.
-There is yet another puraaNic narration on Hayagreevar.
At Kanchi, Sage Agasthya was on severe penance on Lord Narayanan and the Lord appeared as Hayagreeva and was immensely pleased with his tapas. He blessed the muni with Devi mahaathmyam. This is described in BrahmANda puraaNam Sri Hayagreeva agasthya samvaadham.
During Tripurasura samhaara to entice the asurAs, the Lord appeared as "other religious" saint (buddhism?) and appeared as Hayagreeva to mislead the asurAs from the Veda maargham (from the path of Vedic traditions and sayings). Thus, He made them lose their ability to get saved and the Lord won. (As also claimed and reported in Buddhism in a web site as follows: Like Mahakala, Hayagriva is one of the Eight Great Protectors of Buddhism, a guardian and a destroyer of obstacles to enlightenment(!). He is a popular personal, or tutelary, deity among the Gelug order of Tibetan Buddhism.
The terrific neigh that emanates from this horse's head is said to pierce through the illusory nature of reality. Although he was also popular in Tibet and China, Hayagriva's association with the horse may have had a particular appeal to the Mongols. (This, I read in the Net in some buddhism web site!) Scriptures on
Since, Lord Hayagreeva killed the asurAs, madhu and kaitapar, He is referred to as Madhusoodhana.
In BrahmANda puraaNam, Sri RangarajamahAthmyam, Om namO VishnavE Deva MadhussodhanathE Namah: refers to Madhusoodhana Sri Hayagreeva.
Srimad Valmiki RamayaNam BalakaaNdam 76th sargam, 17th slOkam Parasuraama says to Rama "akshayam madhuhanthaaram jaanaami tvaam surOtthamam". I realise that You are the DevaadhiDevan, immortal, MahAVishNu, the One who killed madhu,kaitapha.
Also, when Rama (before proceeding for His PattabhishEkha), gets up in the wee hours, in Brahma muhUrtham, He performs His anushtaanam and pays obeisance to Lord Hayagreevan "dhushtaava praNadhaischaiva sirasaa madhsoodhanam" (6th sargam-7th slokam).
-In Kishkinthaa kaanDam, Vaali tells Sri Rama
"Even if that rAvaNan hids SitA in PaathaaLa lOkam, no problem. You could have just told me so. I world have brought SitA back from anywhere wheresoever like Sri Hayagreevar brought the Vedas killing Madhukaitapar. (17th sargam-49th slOkam)
When Hanumaan went in search of sanjeevini, and other aushadhaas, he saw the place where chathurmukha brahmA worshipped Lord Hayagreeva. Commentators, are reported to have praised this slOkam as "hayaananam, hayagreeva araadhana sthaanam", and "hayaananam - BhagawathO Hayagreevasya sthaanam".
Sri MahAbhAratham, Santhi parvam mentions Haygreeva avataar.
Sri HayagreevOpanishad, naturally elaborates the greatness of Haygreevar.
In Rk vEdam, "vaagham bruNi sookhtham", "apradhiratham", Yajur vEdham, "yajnya prakaraNam", Saama vEdham, udgItam, AdharvaNa vEdham, Shanthikam, Bhaushtikam are all referring to the greatness of Lord Hayagreevar.