Legend has it that when the great demon named Tarakasura propitiated Brahma, he gained the boon that only the son of Shiva would be able to slay him.
Thereafter, the Divine Mother took birth in the home of Himalayas as Parvati, Daughter of the Mountain, and performed tapasya for Shiva to once again accept her as his wife. After many examinations, Shiva agreed to the marriage.
After many tribulations and much prayer by the Gods, the son of Shiva, Kartikeya, took birth from a ray of light which emanated from Shiva. The six Krittikas nurtured the infant child in the Satya Loka, and Ganga taught him wisdom.
At the appropriate time, the young Kartikeya slayed the wicked demon Tarakasura. Mother Parvati, desiring another child of her very own, brought forth Ganesh.
Ganesh’s head was cut by Shiva’s trishula, as he guarded the entrance to Parvati’s private chamber. Afterwards he was given the head of an elephant, for which he became known as the elephant headed God, Gajanan.
When Shiva and Parvati decided to find suitable brides for their sons, Ganesh and Kartikeya argued as to who is to get wedded first.
Lord Shiva bade that the one who circumambulated the world first could get married first.
By the time Kartikeya could go round the world, Ganesh went round his parents seven times (for according to Sastras, circumambulating one’s parents is equivalent to going round the world).
Ganesh was married to Siddhi and Buddhi, the daughters of Viswaroopan.
Kartikeya on his return was enraged and went away to live on Shree Saila Mountain in South India. In order to bring him back to Kailash, Parvati took the form of Malli, a village girl, and Shiva became Arjuna, a tribal youth. At the time of their marriage, Malli and Arjuna showed their true forms as Shiva and Parvati, and Shiva bestowed his eternal light for the establishment of the Mallikarjuna Jyotir Lingam.