According to Hindu mythology, Rahu and Ketu are two parts of the body of one demon, who was beheaded by Lord Vishnu.
(Courtesy: yourfortune.in)
As the story goes, the Ocean was decided to be churned for the attainment of Amrit, the elixir of life. For the churning, Lord Vishnu’s Sheshnag was wrapped around Mt. Mandrachal. One end of the giant snake was pulled by the gods, and the other by the demons. Many precious gems and other things came out of the ocean during the process of churning.
After a lot of hard work, Amrit was finally obtained, which was stolen from gods by the demons. To save it from the demons, Vishnu came in the disguise of Mohini, who said that she will divide the elixir between the gods and the demons equally. Vishnu, in the disguise of Mohini, however, served poison instead of the elixir to the demons.
One demon saw the trick Mohini is playing and he joined the faction of gods to drink Amrit. When Vishnu got to know about this, he beheaded the demon. These two parts of one demon became alive and since then exist independently as Rahu and Ketu.