The great sage, Durvasa Muni, once offered a garland to Indra, who ignored it and put it on the tusk of his elephant, Airawat, which trampled it. Seeing Indra's disregard, the revered sage became furious. He cursed Indra saying that he and the other gods would lose all their powers. In due course, 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 Indra rushed to Vishnu for help.
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, Mandara, 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, Vishnu quickly transformed himself into a tortoise and placed the mountain on his back. This image of Vishnu as the tortoise was his second avatar called 'Kurma.'
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 Shiva to help him them. Shiva appeared before all and gulped the entire poison. But, he did not swallow it. He kept the poison in his throat. Since then, 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, Laxmi; the wish-fulfilling tree, Kalpavriksha; and finally, came 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, Rahu and Ketu, disguised themselves as gods and drank the amrita. The sun and moon gods recognised it to be a trick and complained to 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 Rahu and 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, Vishnu disguised as the enchanting Mohini tricked the demons and recovered the nectar.
While fleeing the clutches of the demons, 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.
Once Garuda got back and the Gods drank the nectar, they became immortal. But as some demons had managed to taste a few drops of the drink, they too became immortal and to this day the fight between good and evil continues.