When Ismail (alayhis salam) was still a small baby, his father Ibrahim (alayhis salam) took him and his mother, Hajra, to the site of the Ka'ba. He gave them some dates and a goat skin full of water and left them there. At that time no one lived at the Ka'ba, and there was no water nearby. As Ibrahim (alayhis salam) was walking away, Ismail's (alayhis salam) mother followed him, asking why she and her son were being left in such a desolate place. She asked several times but he would not answer her. Finally, she asked if Allah had ordered him to do this and he replied that it was so. Upon hearing this, she accepted Allah's will and returned to the site where Ibrahim (alayhis salam) had left her.
As soon as Ibrahim (alayhis salam) was out of sight, he turned and prayed to Allah to protect and provide for his family which he had left out in the wilderness:
"O our Lord! I have made some of my offspring to dwell in a valley without cultivation, by Thy Sacred House; In order, O our Lord that they may establish regular prayer; So fill the hearts of some among men with love towards them, and feed them with fruits; So that they may give thanks." (al-Qur'an 14:37)
Ismail (alayhis salam) and his mother lived for some time on the supply of water and dates, but finally the water began to give out, and Ismail's (alayhis salam) mother could no longer produce sufficient milk to nurse her baby. The baby became agitated and near to death because of his thirst. The mother could not bear to see her child suffering, so she ran to the top of nearby Mt. Safa to see if she could find someone to help her. When she could see no one, she ran down the mountain and across the valley to Mt. Marwa. Seven times she ran from one mountain to the other, looking in vain for assistance. After the seventh time she heard a voice and she called out to it for help. When she looked she saw an angel digging the earth with his heel until water flowed forth. That place was the site of Zam-zam. She carefully made a depression around the place where the water was flowing, and filled her waterbag with her hands. Then she was able to drink water and nurse her baby. The angel told her not to be afraid, that she and her son would be provided for.
Ismail (alayhis salam) and his mother continued to live at the Ka'ba all by themselves for some time. One day some people of the Jurhum tribe were passing through the valley. They didn't intend to stop, because they knew that there had never been any water in that valley. But they saw a kind of bird which was known to frequent wet spots, so they followed it to the spring of Zam-zam. There they found Ismail's mother sitting by the water.
Ismail's (alayhis salam) mother was a very sociable person who loved the company of others, so she readily agreed to their request to stop there for a while, provided that they did not claim possession of the water. Some of the people of Jurhum decided to settle permanently by Zam-zam and sent for their families. Ismail (alayhis salam) grew up with these people and learned to speak Arabic from them. When he grew up, they urged him to marry one of their women.
You can read about Ismail and his mother in Sahih al-Bukhari IV:582-584.