Question: Allah the Exalted mentioned that He responds to the supplication of polytheists when they are on the deck of a ship in the middle of the sea, while the sea rages around them; when they call upon Him in that situation, He answers their supplication and saves them. How does He respond to their supplication while they are polytheists?
It may be said in response: The polytheists in the middle of the sea, when the winds rage and the sea becomes turbulent, turn their hearts and supplication to Allah alone, knowing that none other than Him can save them. They forget their idols at that moment, being certain that these idols have no power to benefit or save them.
At that moment, their call to Allah comes from hearts believing in Allah alone, certain that power and strength belong only to Him; there is no place for idols in their hearts.
Thus, Allah informs us that in such a situation, they call upon Him sincerely, abandoning polytheism temporarily. They supplicated to Allah with the supplication of the distressed, and He answered them and saved them.
Therefore, their supplication at that time was from its proper source, and the response was in its due place. They called upon Allah with the supplication of the distressed, as He said: “Who responds to the distressed when he calls upon Him?” [An-Naml:62].
Furthermore, the response to their supplication serves as a proof against them, a clear sign to turn them away from polytheism and return them to Allah alone, and an additional kindness to them.
It appears to me that the response to supplication can be divided into two categories:
1. Response to the supplication of the distressed: This is the one surrounded by causes of destruction, looking here and there in hope of salvation but finding nothing, losing hope in everything in this world and in the heavens. He turns his heart to Allah, extends his hope to Him, and calls upon Him, certain that none other than Allah can save him. Such a supplicant is answered by Allah, and it is not a condition for acceptance that he was a believer before the supplication, nor that he remains steadfast in faith and obedience after emerging from the distress.
Evidence of this is what has been mentioned regarding Allah answering the supplication of the polytheists in the raging sea. Allah addressed the polytheists in Saurt An-Naml through the tongue of His Prophet (May Allah bless him and his family and grant them peace): “Say: All praise is due to Allah, and peace be upon His servants whom Allah has chosen; is it not that they associate others?” [An-Naml], up to His words: “Who responds to the distressed when he calls upon Him and removes the evil…” [An-Naml:62].
2. Response to the supplication of the non-distressed: This is conditional, in addition to what was mentioned about sincerity in the supplication of the distressed, that the supplicant be obedient to Allah, consistent in piety, and repentant to Him. This is based on His words: “I respond to the supplication of the supplicant when he calls upon Me; let them respond to Me and believe in Me, so that they may be guided” [Al-Baqarah:186]. Allah thus made the response contingent upon obedience to His commands and refraining from what He forbids, along with maintaining faith—making this the cause and reason for the acceptance of their supplication, which leads to their guidance and success. Allah also says: “Indeed, Allah only accepts from the righteous” [Al-Ma’idah].
Source: Min Thimār al-ʿIlm wa al-Ḥikmah vol.3