The Asura Taraka was the son of Vajranaga and Varangi. He had been born as a result of a boon obtained by his father from Lord Brahma, to avenge the torments suffered by his mother Varangi at the hands of Indra the chief of the Devas. After his father's death, Taraka was crowned the king of the Asuras.
Taraka performed many tough penances in a cave in the Pariparta mountains. Pleased with his devotion, Lord Brahma appeared before him and offered him a boon. Denied the boon of immortality, the Asura chose that he be slain only by a seven year old boy.
With the help of this boon, he amassed a large army, including the great Asura warriors Jambha, Kujambha, Mahisha, Kunjara, Megha, Kalanemi, Nimi, Mathana, Jambhaka and Shumbha and invaded the heavens. The Devas marched to battle, led by Yama on his buffalo. Indra on his chariot, Varuna on a snake, Agni on a goat accompanied this army. The Asuras quickly gained the upper hand, with Kubera being forced to flee from the battlefield by Kujambha. Chandra and Surya were assaulted by Kalanemi. The Ashwini twins were defeated by Kalanemi. Scared by their losses, the Devas sought the help of Vishnu. At once, the Lord appeared and promptly slew an Asura named Grasana. He then knocked Kalanemi unconscious. Vishnu in turn was knocked unconscious by a blow from Jambha's club. In retaliation, Indra slew Jambha with his thunderbolt.
The tide of the battle seemed to be turning the way of the Devas.
However, Taraka was invincible. Thanks to the boon from Brahma, no deity was able to conquer him. They were left with no choice but to flee. Countless Devas were taken prisoners.
Indra and the Devas who escaped from the battlefield went to see Lord Brahma. They said, "You have created a monster! Where can we find a seven year old child who can slay the might Taraka? We are doomed!"
Brahma said, "Fear not. The child of Rudra shall be the slayer of this evil demon. The only problem is that after the death of his wife Sati, Shiva has lost all interest in worldly affairs. Sati has now been reborn as Parvati, the daughter of Himavan. She has been indulging in daily prayers to obtain the Lord of the Universe as her husband. All you have to do is to arrange for their marriage, and your problems shall be solved."
The marriage was arranged with the help of Kama, the God of love. However, Kama was burned in the process. His wife Rati successfully pleaded for his life and Shiva revived him. Skanda was born in the Sara Vana, from the seed of Shiva carried thither by Agni. [More on that story here.]
When the child Skanda reached the age of seven, the Devas decided that it was time he was appointed their leader. Accordingly, Lord Brahma commissioned a grand ceremony, in which the child would be anointed as the generalissimo of the Devas. The spot chosen was on the banks of the river Saraswati. Brihaspati was the master of ceremonies for this ritual. All the deities were present, and they brought many costly gifts to the child-warrior. The boy was invested with the command of the army accompanied by the chants from the Vedas and was bathed with the sacred waters by Kashyapa and Brahma.
Lord Brahma created four companions for the young warrior. They were: Nandisena, Lohitaksha, Ghantakarna and Kumudamalin. The Lord Sthanu gave a companion skilled in the art of magical illusion to the boy. Lord Yama gave him two powerful companions named Unmatha and Pramatha. Surya gave him two followers named Subhraja and Bhaswara. Soma gave him two followers named Mani and Sumani. Agni gave him two powerful companions named Jwalajibha and Jyoti. Ansa gave him five intelligent friends named Parigha, Vata, Bhima, Dahati and Dahana. Indra gave him two warriors named Utkrosa and Panchaka, armed respectively with thunder-bolt and club.
Vishnu then gave the boy three companions, named Chakra, Virama and Sankrama. The twin Ashwinis gave him two warriors named Vardhana and Nandana. The God Dhatri gave him five followers named Kunda, Kusuma, Kumuda, Damvara and Adamvara. Tvashta gave him two companions named Chakra and Anuchakra. Lord Mitra gave the boy-warrior two illustrious companions named Suvrata and Satyasandha. The God Vidhatri gave two companions named Suprabha and Subhakarman. Pushan gave two followers named Panitraka and Kalika, who were skilled in the art of illusion. Vayu gave him two warriors named Vala and Ativala, who were as strong as the wind. Himavan gave him two followers named Suvarchas and Ativarchas. Meru gave him two companions named Kanchana and Meghamalin. Manu gave two strong warriors named Sthira and Atisthira. Vindhya gave him two companions named Uschrita and Agnisringa, whose preferred weapons were stones. Sagara (Ocean) gave him two mighty companions named Sangraha and Vigraha, who were skilled with maces. Parvati gave him warriors named Unmada, Pushpadanta and Sankukarna. Vasuki, the king of snakes gave Skanda two snake-warriors named Jaya and Mahajaya. All the other deities also gave him warriors to make up his army.
A huge army of women warriors, endued with the power of Agni and Vayu, formed a part of his army. (The [Maha:9.46] lists the names of all these women warriors). The army amassed, it was time to equip the boy warrior with divine weapons. The slayer of Paka (Indra) gave the boy a dart blazing with light. Indra gave him an effulgent banner. Shiva sent him his followers equipped with divine weapons. Vishnu gave him a garland that enhances the might of the wearer. Parvati gave him radiant clothes. Ganga equipped him with a celestial water-pot, filled with Amrit. Brihaspati gave him a sacred stick. Garuda gave him his favorite son, a peacock, who became the mount of Skanda. Aruna gave him a fighting cock of sharp talons. Varuna gave him a powerful snake. Lord Brahma gave him a deer-skin cloth to wear, and the boon of invincibility.
Assuming command of these divine forces, Kartikeya thanked all the Gods for their support and assured them that he shall lead them to victory over their foes. An auspicious time was chosen to begin the march on the Asura cities.
When Taraka heard from his spies that the forces of the Devas was getting ready to invade, he rallied his forces and marched them outside. The two great hosts met on a battlefield near the Krauncha mountains. The battle was hard fought. Slowly, the Devas gained the upper hand. Unable to withstand the might of Skanda, the Daityas fled in all directions. On this day, the boy slew the Asuras by the millions.
Seeing his army scatter in all directions, Taraka sought out Kartikeya in the battlefield and engaged him in combat. He taunted the boy about his tender age, but was quickly forced to concentrate his energies in battle, for he saw that his opponent was a warrior of great merit. At last, the demon fell down dead, pierced by the spear of Kartikeya.
The scrouge of the Devas was slain, but many of his able commanders were still alive. The battle still raged on. Next, Skanda slew Bana, the son of Bali, who tried to hide in the Krauncha mountain. This demon was slain by a divine dart. The younger son of Bali was also slain this day.
The victorious army of the Devas returned to the heavens, having annihilated their foes. From that day, Skanda became one of the principal Devas, their commander-in-chief.