When Musa (as) killed the person from Qabt, the followers of Fir’awn schemed to have him murdered, and so he fled from Egypt. After travelling for between three and eight days and enduring great troubles, he reached the city of Madyan, where he stretched out to rest beneath a tree situated near a well.
He realized that there were two ladies standing near the well, waiting for the shepherds to finish drawing water so they too could draw water from the well. He went to them and offered to help by drawing the water for them. As a result of Musa’s help, the women brought the water home sooner than usual and this prompted their father, Sho’aib (as) to inquire: “How did you manage to bring the water sooner than usual today?”
They narrated to him the entire episode, whereupon Sho’aib said, “Go to the man and bring him to me in order that I may reward him for his act.”
The ladies approached Musa (as). As soon as they conveyed their father’s message to him, he immediately agreed, as he was hungry, tired and a stranger in the place. The maidens led the way while Musa (as) followed them, but as they walked, the outlines of their bodies became visible and this appeared unsuitable to Musa’s modesty (to look at). Consequently, he said to them: “I shall lead the way while you follow up behind me; correct me if you find me heading in the wrong direction (or throw pebbles before me so that I know where to go) for we, the children of Ya’qub, do not look at the backs of women.”
When the ladies approached Sho’aib (as) and related the incident to him, he gave his daughter in marriage to Musa (as), owing to the latter’s assistance, modesty, purity, trustworthiness and physical strength.( Tarikh-e-Anbiya, Volume 2, Page 65-71)