Sayyiduna Abdullah bin Mas'ud (may Allah be pleased with him) said: The Messenger of Allah (peace and blessings be upon him) said: "There are some angels of Allah who roam the earth and convey the greetings of my Ummah to me."
From this hadith, it is understood that the Messenger of Allah (sallallahu alayhi wa sallam) does not hear salutations (salat and salam) directly himself; rather, there are angels appointed who roam throughout every corner of the world, and whoever says in prayer: «اَلسَّلَامُعَلَيْكَأَيُّهَاالنِّبِيُّوَرَحْمَةُاللّٰهِوَبَرَكَاتُهُ», those angels convey his salutation to the Prophet (sallallahu alayhi wa sallam).
The attribute of being All-Hearing and All-Knowing (Sami‘ wa ‘Alim) is fitting and appropriate only for Allah Ta‘ala; to associate any prophet or saint (wali) in this attribute is open shirk (polytheism).
May Allah Ta‘ala grant everyone the ability to understand, ameen.