Sayyiduna Ibn Abbas (may Allah be pleased with them both) narrates from Sayyiduna Ubayy bin Ka'b (may Allah be pleased with him) that the Prophet (peace and blessings be upon him) said: "When Jibril (peace be upon him) struck (the spot of) Zamzam with his heel, the mother of Isma'il began gathering sand and earth." Then the Messenger of Allah (peace and blessings be upon him) said: "May Allah have mercy on Hajar, or (he said) the mother of Isma'il; had she left it (as it was), it would have been a flowing spring."
Related hadith on this topic