Bereshit / Genesis 21:17 · Sod
וַיִּשְׁמַע אֱלֹהִים אֶת־קוֹל הַנַּעַר וַיִּקְרָא מַלְאַךְ אֱלֹהִים אֶל־הָגָר מִן־הַשָּׁמַיִם וַיֹּאמֶר לָהּ מַה־לָּךְ הָגָר אַל־תִּירְאִי כִּי־שָׁמַע אֱלֹהִים אֶל־קוֹל הַנַּעַר בַּאֲשֶׁר הוּא־שָׁם׃
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.
Sod סוֹד
The one who returned
The angels say "he is righteous now" of someone who, according to the midrash, had already served idols. How can that be? A Chasidic teacher finds the answer in the first letters of the three words "where he is".
Be'er Mayim Chaim: in his illness Yishmael repented. So the angels admitted: now, at this very minute, he is righteous, not before and not after. And the Eternal in His mercy judged him by this minute. The first letters of "ba'asher hu sham" (בַּאֲשֶׁר הוּא שָׁם), ב, ה, ש, make "ha-shav" (הַשָּׁב), "the one who returned". His mother repented too, and the Almighty kept them both alive.
How Be'er Mayim Chaim explain it
Be'er Mayim Chaim And an angel called etc., and said to her: what troubles you, Hagar? Do not fear, for the Almighty has heard the voice of the boy where he is
That is: what troubles you, Hagar, that you fear for yourself, lest you die as the child is dying? Do not fear this: not only will you live and be saved from death, but also "The Almighty has heard the voice of the boy where he is". It is known what the sages said (Bereshit Rabbah 53:14): the ministering angels wanted to accuse: a man who will one day kill Your children, and so on. And the Holy One, blessed is He, answered: what is he now? Righteous, and so on. At first sight, by the plain sense, how could they say "now he is righteous"? Had he not already served idols while in his father's house, and Sarah saw it with her own eyes? But by our words it is right: he repented of his sins during his illness. For although the verse calls him a boy, he was already twenty-seven years old, as our sages, of blessed memory, said (there, 53:13). So when he repented, they said "now he is righteous", at this very minute, not before and not after. For later he robbed people, as it is written (16:12): "his hand against all". The Holy One, blessed is He, in His mercy judged him by this minute, and he was found righteous in judgement, and the Almighty brought up a well for him. Therefore the first letters of "ba'asher hu sham" (בַּאֲשֶׁר הוּא שָׁם) are "ha-shav" (הַשָּׁב), "the one who returned": a hint that he returned at that very minute. And his mother repented too, and the Holy One, blessed is He, took her pain before Him and kept her and him alive.
Takeaway
"To return" (שׁוּב) in Hebrew is also "to repent": teshuvah (תְּשׁוּבָה) means "return".
That Yishmael served idols the midrash learns from the word "mocking" (מְצַחֵק) in 21:9, and Rashi cites it too.
The midrashim count Yishmael's age differently: Rashi speaks of seventeen, Be'er Mayim Chaim cites twenty-seven.