Bhagirahta was the well acclaimed fore father of Rama of Raghu Vamsa and as folklore goes his forefathers were known as sagaras and they had been burnt down due to a curse in the past . And it was for the elevation of these ancestors from the curses to a state of being transported to heaven, is it that Bhagiratha was very keen on bringing the holy river Ganga to the Earth.
This intention was with the belief that the moment h holy waters of the river Ganga were to touch the ashes of the sagaras, they would immediately be released from the curse on them for their sins.
With this in mind Bhagiratha did very severe penance with the sole objective of getting the blessings of Lord Indra for this, and indeed this permission was granted but with the condition that although he was permitted to bring the river Ganga down from Heaven to the Earth, the actual decision of coming down to the arth would be that of Ganga.
Therefore BhagIrahta again started his austerities and prayed to the goddess Ganga., to which she agreed but at the same time clarified that he should locate a person who could withstand the force with which she will descend to earth Bhagiratha agreed to this and zeroed down to the refuge- i.e. the most powerful Lord Shiva !
Having decided on this he did severe austerities for pleasing Lord Shiva., who on appreciating his devotion and efforts, agreed to hold the Ganga on it's downward trip from Heaven to the Earth . On hearing of this Ganga out of her sheer ignorance and pride thought that Lord Shiva would not be able to withstand her force !
She therefore came down with the intention of pushing the Almighty Lord , creator of the entire universe down with her heavy force, not realising that she was insignificant in front of the Lord ! The Lord arrested the flow of the Ganga in His matted hair, and even though she tried her level best to rush out of His matted hair, it was all in vain. since not even a single drop of water could escape !
Bhagiratha got very worried by these developments as it had been his initial intention to bring down the Ganga to planet Earth, and he therefore again prayed to the Lord to show mercy on her. and to this the Lord readily agreed by allowing the Ganga to pass through a strand of His matted hair.
Now, the visibly humbled Ganga flowed very humbly and with tremendous grace, extending ample prosperity on her way to Patala, and it was in this way that the antcestors of BhagIratha were brought to heaven by the holy water of the Ganga !