the first demons is Rahu
Do you remember the churning of the primordial ocean, the Samutramanthan? Well the Gods and demons were once allies, they had rolled up the serpent Vasuki around Mount Mandara, the Gods had seized it from the head and the demons from its tailor and began to spin around the mountain, which rested on Kurma, the tortoise.
The first of the demons who grabbed the snake was called Rahu.
From ocean churning emerged many things, but most important was the amrita, nectar of the Gods, also called soma, the drink that gave power and, above all, eternal live (in fact the Sanskrit amrita is made "a" privative "mrita" "death" like mortis in Latin : "no death").
Obtained the drink, the Gods and demons began to fight again. Each of them wanted to drink the soma and, after a hard struggle and many deceptions, the Gods were somehow better.
But when peace seemed restored, and the Gods, in turn, drank the drink, Surya (the Sun) and Soma or Chandra (the Moon), found that Rahu, the demon, had slipped between the Gods and was drinking the nectar.
Surya and Chandra gave the alarm and the God Vishnu threw the disc Sudarsana, one of his main weapons against Rahu and he was decapitated.
The head of Rahu splashed in the sky and the body fell loudly on the ground causing a terrible hearthquake.
But Rahu had already drank a bit of 'soma' which had come up to his neck. Therefore, the body fell on the earth perished as all mortal things, while the head of Rahu gained eternal life.
The demon, betrayed by Surya and Chandra, wanted revenge on the two 'spies' and perpetually chasing them in the sky. Periodically Rahu (in Sanskrit "Rahu" meaning "he who grasps") reach es them and swallows them, but having no longer the body, once swallowed Chandra the moon, and Surya, the Sun, they re-emerge from the neck of the demon.
Here is the explanation of the eclipses of the sun and moon.