Taraka wished to defeat the gods. He therefore went to a place named Madhuvana and began to perform very difficult tapasya. He gazed at the sun and stood there with his arms raised. He stood on one leg and that too, only on the toes of his feet. A hundred years passed. For those hundred years, Taraka drank only water and had no food to eat. For the next hundreds, he gave up that also and lived only on air. A hundred years were spent in performing tapasya inside water, another hundred years on earth and a hundred years more inside fire. For a hundred years he performed tapasya upside down, standing on his hands. And for yet another hundred years, he hung upside down from the branches of a tree.
The meditation was so difficult that Brahma was pleased. He appeared before Tarakasura and said, I am pleased with your tapasya. What boon do you want?
If you are pleased, replied Tarakasura, grant me two boons. The first boon should be that no one created by you should be as strong as me. The second boon should be that I should be killed only by Shiva's son.
Shiva at that point of time had no sons. Sati had died and although she had been reborn as Parvati, she had not been married to Shiva.
Brahma granted Tarakasura the two boons. The demon went to a city named Shonitapura and began to live there. All the other demons made Tarakasura their king. Thanks to the boon. Tarakasura was so strong tha the easily defeated the gods. He conquered the three worlds and drove the gods out of heaven. He stole all their belongings and employed the gods as his servants.
The despondent gods went to Brahma and asked him to find a solution to the Tarakasura problem. I can't, said Brahma. It is because of my boon that the demon has become so powerful. Besides, my boon says that Tarakasura can only be killed by Shiva's son. Shiva has got to have a son. He is now performing tapasya in the Himalaya mountains. Parvati is also in that region. Do something so that these two fall in love with each other and marry.