Neither King Amshuman nor his son, King Dilipa, was able to bring Ganga to cleanse their ancestors. But King Bhagiratha, Dilipa's son, managed to do this through his fervent devotion and prayers. For this reason, Ganga is also called Bhagirathi.
Lord Brahma informed Bhagiratha that only Lord Shiva had the power to withstand the immense force with which Ganga would descend to the earth. So, Brahma advised Bhagiratha to seek Shiva’s help. In response to Bhagiratha's prayers, Shiva agreed to control the speed at which Ganga would reach the earth.
As Ganga descended, Shiva untied and spread his hair. After Ganga filled up Shiva’s hair, he retied it in a knot. Soon, Ganga began to flow out of Shiva’s hair at a steady speed.
During Ganga's journey on the earth, she happened to disturb Sage Jahnu's meditation. The angry sage drank up the entire river. But, upon the gods' request, Sage Jahnu let Ganga flow out of his ear. Hence, Ganga has another name: Jahnavi, meaning "daughter of Jahnu."
Thus, Ganga came to the earth and liberated Bhagiratha's ancestors.