The legend behind the Palani temple is very famous. One day, when all was well in Mount Kailash, the sage Naradha went to pay his respects to the Destroyer. He had with him the 'nyana pazham' or the fruit of knowledge. When he offered it to Shiva, who in turn offered it to his offspring, there arose the question as to who would have it - Ganesha or Skanda. To help them arrive at a decision, Shiva and Parvati said that whoever circumbulates the universe and reaches them first will be declared the winner.
The minute these words were uttered, Lord Subramanya jumped on his vahana, the peacock to go around the Universe. Lord Ganesha thought for a minute and came around his parents. Thus declaring that they are the Universe. His delighted parents gave the fruit to him when Lord Muruga reached Mount Kailash after finishing his round. Seeing that he has been defeated made the young God angry and he left his parents and settled in Palani. He denounced all his riches, including his grand clothes - which explains the aandi pose at Palani.
Another legend attached to this temple is based on Sage Agasthiyar. Lord Shiva presented the holy sage with two mountain peaks, Shivagiri and Shaktigiri. Agasthiyar bade his disciple Idumban to carry the two hills. To make this easier, Idumban joined the two hills by means of a pole and carried it over his shoulders. When he came near Palani, he was exhausted and took a moment of rest. While doing so, he kept his load down. At this, the hills got stuck to the ground. While he tried to shift them, Lord Muruga, who was atop one of these hills, fought with Idumban and killed him. But Sage Agasthiyar implored the Imperial Commander to restore Idumban back to life. Lord Muruga agreed to this and gave life to Idumban, who wished to be a dwara palagan at the temple at Palani. Lord Muruga granted his wish. The way in which Idumban carried his load is said to be the origin of the kavadi worship .
SKANDA LEGEND PALANI :Murugan slaying the demon SurapadmanSati, the consort of Shiva immolated herself at the Daksha Yagna, which was later destroyed by Shiva. Sati was reborn as Uma, or Parvati the daughter of the mountain king Himavaan (the Himalayas). Shiva withdrew himself from the universe and engaged himself in yogic meditation in the Himalayas.
In the meanwhile, the demon Surapadman ravaged the earth and tormented its beings. It was realized by the gods that only the son born of Shiva could lead the gods to victory over Tarakasuran, Surapadman and their demon companions. They plotted with Kamadeva, to shoot a flower arrow at Shiva, as he sat in meditation, so as to make him fall in love with Parvati. When Kama aimed his arrow at Shiva, he opened his third eye and burned him to ashes instantly.
The sparks of the fiery seed of Shiva were unbearable; even the fire God Agni could not bear them; this fire was then transported by the river Ganga into the Sara Vana forest into a pond called Sara Vana Poigai(located at mouths of river Ganga), where the sparks became six children.They were raised by the six Krittika or Kartika - the stars that make up the Pleiades, earning the name Karthikeya. Parvati combined these six babies into one with six faces, ie. Shanmukha. Since he was born in the Sara Vana he was also called Sara Vana Bhavan. Murugan became the supreme general of the devas and led the army of the devas to victory against the demons. The six sites at which Karthikeya sojourned while leading his armies against Surapadman are Tiruttanikai, Swamimalai, Tiruvavinankudi (Palani), Pazhamudirsolai, Tirupparamkunram and Tiruchendur. All these sites have ancient temples glorified by the Tamil poems of Tirumurugaatruppadai of the Sangam period