Great sage, Durvasa Muni, once offered a garland to Lord Indra, who ignored it and put it on the tusk of his elephant, Airawat, which trampled it. Seeing Lord Indra's disregard, the revered sage became furious. He cursed Lord Indra saying that he and the other gods would lose all their powers. In due course, Lord Indra and the other gods began losing all battles against the demons, and the demons led by Bali took control of the universe.
Seeing no other means, the helpless Lord Indra rushed to Lord Vishnu for help.
Lord Vishnu had a plan. He said that to get back their powers the gods would have to churn the oceans and bring out the magical nectar-amrita. Only after consuming it could they regain their powers. This great churning is known as samudra manthan. But as the gods were powerless now, they sought the help of the demons to accomplish this huge task.
The gods and demons got together for the the herculean task. The huge mountain, Mandarachal, was used as the pole to stir the waters. But as the pole entered the water it kept sliding into depths of the ocean. To stop this, Lord Vishnu quickly transformed himself into a tortoise and placed the mountain on his back. This image of Lord Vishnu as the tortoise was his second avatar called 'Lord Kurma Avatar.'
Once the pole was balanced, it was tied to the gigantic snake, Vasuki, and the gods and demons started pulling it from either side. As the churning began and the massive waves whirled, an extremely poisonous drink called halahal came out. The gods became scared because this blue drink could destroy creation.
They all got together and prayed to the powerful God Lord Shiva to help him them. Lord Shiva appeared before all and gulped the entire poison. But, he did not swallow it. He kept the poison in his throat. Since then, Lord Shiva's throat became blue, and he became known as Neelkantha or the blue-throated one.
The churning continued and poured forth a number of gifts and treasures. They included Kamdhenu, the wish-fulfilling cow; the goddess of wealth, Goddess Laxmi; the wish-fulfilling tree, Kalpavriksha; and finally, came Lord Dhanvantari carrying the pot of amrita and a book of medicine called Ayurveda. Once the amrita was out, the demons forcefully took it away. Two demons, Lord Rahu and Lord Ketu, disguised themselves as gods and drank the amrita. The sun and moon gods recognised it to be a trick and complained to Lord Vishnu, who in turn, severed their heads with his Sudarshan Chakra. As the divine nectar did not get time to reach below the throat, the heads remained immortal, but the body below died. This helps Lord Rahu and lord Ketu take revenge on the Sun and Moon by devouring them every year during solar and lunar eclipse.
A great war between the gods and demons followed. Finally, Lord Vishnu disguised as the enchanting Mohini tricked the demons and recovered the nectar.
While fleeing the clutches of the demons, Lord Vishnu gave the amrita to his winged charioteer, Garuda. But the demons caught up and a tussle followed. During this tussle few drops of the drink fell at Ujjain, Nasik, Allahabad, and Haridwar.
The drops are said to have purified the land and it is here that every year devotees come to wash away theit sins in the famous assembly called Kumbh Mela.