Amrit Manthan
During Amrit Manthan, Vishnu came as Mohini. She gave the asuras only a smile and gave the amrit to the devas. When one asura sneaked into the deva line, she struck his head with the ladle, and he split into Rahu and Ketu. Bhagavan knows who needs what and gives accordingly.
Amrit Manthan

During the churning of the ocean (Amrit Manthan), Vishnu took the form of Mohini. Mohini gave only her smile to the asuras. The asuras were attracted only to Mohini, so they did not care about the amrit (the nectar that gives long life). So Mohini gave the amrit to the devas.
Then one asura saw what was happening. He understood that the asuras were not getting anything. So he sneaked away and went towards the deva side. But Mohini knew exactly what was happening. She hit his head with the ladle. The asura broke into two parts. The head and the body became Rahu and Ketu.
What the story teaches
Bhagavan knows who needs what, and He gives to each one accordingly. The asuras are powerful even without amrit, so they did not need it. The devas needed it, so He made sure they got it.
There is a second lesson in the Ramayana. The Sanjeevani mountain helped the vanara army that had died, and they came back to life. In Ravana’s case, the dead asura army was thrown into the ocean for the fish to eat. If they had not been thrown into the sea, even they would have gained from the Sanjeevani mountain. Bhagavan wants the same good for everyone.
Where this story is found in the Sahasranamam
This story is linked to names 458 to 470 of the Vishnu Sahasranamam, for example Vīrabāhuḥ, Vidāraṇaḥ, Svāpanaḥ and Svavaśaḥ. Names 458 to 463 can also be linked to Nara and Narayana.