Legend of Kapila Muni
According to the legend, King Sagara of the Ikshvaku dynasty ruling at Ayodhya in Uttar Pradesh had two queens, Keshani and Sumati, but neither had a child. Sagara performed severe austerities before his wives could produce sons. But whereas Keshani gave birth to a son called Asmajas, Sumati bore 60,000 sons. Sagara performed the Ashwamedha Yagya sacrifice to declare his suzerainty over the neighbouring kingdoms. According to the prevalent custom, the sacrificial horse was let loose and allowed to wander into the neighbouring kingdoms. If the horse was caught, a battle ensued and the outcome decided the winner. The 60,000 sons of Sagara were following the horse when they saw him enter a cavern where sage Kapil Muni was meditating. Not seeing the horse in the cavern, they presumed that Kapila had captured it. They did not kill Kapil Muni as he was a sage but they started disturbing his meditations. Annoyed at being disturbed, Kapil Muni with a curse burnt the 60,000 sons of Sagara.
Time passed and later Bhagiratha, the great grandson of Sagara, chanced to come across the bones of his dead ancestors. He wanted to perform the shraddha of his ancestors but there was no water available for the ceremony. Agastya having drunk all the waters of the ocean, the country was passing through a severe drought. Bhagiratha prayed to Brahma, the Creator, to end the drought. Brahma asked him to pray to Vishnu, the Preserver, to allow the heavenly Ganga, issuing from His big toe, to come down to earth. Vishnu when prayed to by Bhagiratha agreed, but asked him to request Shiva, the third member of the Hindu trinity of Gods, to allow the torrential rain to fall on his head before it came to the earth as the river was very forceful and if she were allowed to come down unchecked, her fall would split the earth. Shiva agreed to take the gigantic weight of the cascading Ganga on the matted hair piled high on his head. This ensnared and delayed the progress of the river which, in meandering through the labyrinth of his hair, lost its force and then gently descended to the Himalayas from whence it flowed to the plains bestowing its waters on the parched earth. And that is why the anthropomorphic image of Ganga is shown in the matted hair of Shiva who is also called Gangadhara. Being born in the Himalayas, Ganga is considered the elder sister of Parvati, who is also a daughter of the Himalayas