There are many realities of life that Hindu teaches us through stories and they have profound meanings associated with it. There is a story about how Shiva held Ganga in his matted locks, and thus Shiva and Ganga are associated.
The Underlying Story
King Bhagiratha pleased Brahma after his great-grandfather Sagara angered Kapila that he stole a sacrificial horse that was supposed to be used for Ashwamedha Yagya.
The horse had actually been stolen by Indra who had the underlying fear that Sagara would be more powerful once he performed the Yajna. Kapila cursed Sagara that he and his descendants will never be able to Moksha unless they bring Ganga to earth from heavens.
Brahma thus asks Ganga to descent the earth, but Ganga instead gets offended by it and destroys parts of the earth with her might force. So, Bhagiratha then went to Lord Shiva to combat Ganga’s rage. Shiva agrees to help him and descends to earth. Ganga descended with extreme force thinking that she would wash Shiva as she had not seen Shiva’s power before. But as we are all aware of Shiva’s power, he holds her tightly in his matted hair. Ganga realized that Shiva was no ordinary and calmed down after realizing it. From then on, Shiva is known as Gangadhar.
The meaning
The material world is tempting and only people with a stable and strong mind can control the temptations. To attain the truth, a person needs to be unshakable and only with stability, a person can attain peace and happiness.
In order to defeat arrogance and pride, a strong mind is necessary. In this case, Ganga’s force represents arrogance while Shiva represents the strong mind. The story tells us that the strong mind will always overcome the arrogance and the forces of temptations within, and calls for followers to develop the mind as that of Shiva and be a part of Gangadhar.