21:17

וַיִּשְׁמַע אֱלֹהִים אֶת־קוֹל הַנַּעַר וַיִּקְרָא מַלְאַךְ אֱלֹהִים אֶל־הָגָר מִן־הַשָּׁמַיִם וַיֹּאמֶר לָהּ מַה־לָּךְ הָגָר אַל־תִּירְאִי כִּי־שָׁמַע אֱלֹהִים אֶל־קוֹל הַנַּעַר בַּאֲשֶׁר הוּא־שָׁם׃

And the Almighty heard the voice of the boy, and the angel of the Almighty called to Hagar from heaven and said to her: "What troubles you, Hagar? Do not fear, for the Almighty has heard the voice of the boy where he is.

Bereshit 21:17

וַיִּשְׁמַע אֱלֹהִים אֶת־קוֹל

Bereshit / Genesis 21:17 · Drash

Bereshit 21:17

וַיִּשְׁמַע אֱלֹהִים אֶת־קוֹל הַנַּעַר וַיִּקְרָא מַלְאַךְ אֱלֹהִים אֶל־הָגָר מִן־הַשָּׁמַיִם וַיֹּאמֶר לָהּ מַה־לָּךְ הָגָר אַל־תִּירְאִי כִּי־שָׁמַע אֱלֹהִים אֶל־קוֹל הַנַּעַר בַּאֲשֶׁר הוּא־שָׁם׃

And the Almighty heard the voice of the boy, and the angel of the Almighty called to Hagar from heaven and said to her: "What troubles you, Hagar? Do not fear, for the Almighty has heard the voice of the boy where he is.

Drash דְּרָשׁ

Tears in a flask

Hagar sets out with a skin of water, and the water runs out. King David in Psalms asks: "put my tears in Your flask." The midrash links the two flasks and tells what was happening in heaven while the boy was dying of thirst.

Bereshit Rabbah: David says: You were not deaf to Hagar's tears, will You be deaf to mine? The angel called Hagar by Avraham's merit, while the boy was saved by his own merit. The ministering angels accused: his descendants will kill Your children with thirst! The Almighty's answer: what is he now? I judge a person only in his hour. And when the Almighty opened Hagar's eyes, she hurried to fill the skin: she still lacked faith.

How Bereshit Rabbah explain it

Bereshit Rabbah

This is what is said: "You have counted my wanderings, put my tears in Your flask" (Tehillim / Psalms 56:9), like that woman with the flask. As it is written in the book of Psalms (39:13): "Hear my prayer, O Eternal, and give ear to my cry" and so on: to Hagar's tears You were not deaf, and to my tears You will be deaf? And if you say she was dear because she was a stranger, so am I: "for I am a stranger with You, a sojourner, like all my fathers". "And the angel of the Almighty called to Hagar": by the merit of Avraham. "Where he is": by his own merit. The prayer of a sick person for himself is best of all. "Where he is": said rabbi Simon, the ministering angels leapt up to accuse him. They said before Him: Master of the worlds, for a man who will one day kill Your children with thirst, You bring up a well? He said to them: what is he now, righteous or wicked? They said to Him: righteous. He said to them: I judge a person only in his hour. "Arise, lift up the boy." "And the Almighty opened her eyes": said rabbi Binyamin, all are presumed blind until the Holy One, blessed is He, opens their eyes. From here: "And the Almighty opened her eyes, and she went and filled the skin": this says that she was lacking in faith.

Takeaway

The name "Hagar" (הָגָר) sounds like "ha-ger" (הַגֵּר), "the stranger". David in Psalms also calls himself a "ger", a stranger.
"Lacking in faith": Hagar hurried to fill the skin, as though the well might vanish. It was not enough for her that the water was here and now.
"All are blind until the Almighty opens their eyes": the well may have been nearby all along, but not everyone is given to see it.