God can hear all prayers because He is omnipresent and omniscient. Omnipresent means He is everywhere, so He can hear you. Omniscient means He knows everything, so He even knows your thoughts before you pray.
It’s difficult, if not impossible from a human point of view, to imagine how God can be everywhere and know all things. But it’s also difficult to understand how God could create the universe and all that is in it. Yet we know He did. Both His Word and what we observe all around us testify to HIs creative works. So also, God assures us in His Word that He hears our prayers. (John 5:15, 1 Pet 3:12).
So even though we can’t understand how God hears the prayers of so many people, we can trust that He does hear all prayers and that He does answer. Read more: Why is Prayer Important?Why didn’t God answer my prayers and heal my loved one? What are the various types of prayer? How should I pray?