There are several curious things about this passage.
First, the woman is crying with a child (yeled), but God says he hears the voice of the young man (na'ar). Yeled is a pre-pubescent child but na'ar is a post-pubescent young man, of marriageable age.
Na'ar can be used to refer to both men and women, and when referring to a woman it is often translated as "maiden", but when referring to man it is often translated as "young man", in both cases the context being that of someone capable of marrying.
So not only did God hear the voice of Ishmael who said nothing, but he heard the voice of the man that Ishmael was to become.
In this passage the translators were in a bit of quandary since Ishmael was clearly a child, not a young man, so they translated na'ar as "boy" in order to try to hide the inconsistency. But in doing so, they are covering over what is clearly a prophecy:
Gen 21.17 LEB
And God heard the cry of the [na'ar] and the angel of God called to Hagar
from the heavens and said to her, “What is the matter Hagar? Do not be
afraid, for God has heard the cry of the [na'ar] from where he is.
That phrase from where he is: בַּאֲשֶׁ֥ר הוּא־שָֽׁם׃ is literally "in which he is there". That is, God heard the voice of the man as being there in Hagar's cry. When Hagar cried out, God heard the voice of the son.
By calling him na'ar, In God's eyes, Ishmael is on the cusp of being the father of many nations, just as in God's eyes Hagar is the mother of Ishmael that does not have any lack, and not a frightened handmaiden that is about to die of thirst.
Why is Ishmael on the cusp -- what other thing is needed for Ishmael to actually become a great nation? I think it is that Hagar's eyes need to be opened. Once her eyes are opened, she is able to find him a wife. So God opens her eyes in order to allow Ishmael to have a bride. The pericope ends with Gen 21.21 (LEB)
And he lived in the wilderness of Paran. And his mother took a wife
for him from the land of Egypt.
This is just like the story of Jacob, he needed to have his eyes opened so that he saw God in order to become Israel. Israel means "she/he who sees God". Both the stories of Jacob wrestling in the dark (where you can't see, but his name is changed to Israel at dawn) and Hagar wailing in the wilderness were the process by which God opened their eyes. There is always a travail of some kind required.
So it's not that God was ignoring Hagar's crying, he did respond to her by opening her eyes, but he did not respond to her because she was crying, he responded to her because of the son. Similarly God opened the eyes of Jacob because of the promise he made to Abraham that Messiah would be of his seed. It is for the sake of the messiah, so that the son can have a bride, that God opens eyes. This is the message of the story.