Prayer is very important in Islam, as it is one of the greatest pillars of faith, and it is the dividing line between faith and disbelief. Therefore keeping up with it is one of the signs of faith, and it cannot be described as merely an outward display of being Muslim, or that doing it consistently is part of outward adherence to Islam. Rather praying consistently is one of the greatest branches of faith, and is a deed that is one of the best deeds of the people of faith after the twin declaration of faith (Shahadatayn).
Despite that, we do not deny the fact that many Muslims fall into shirk (associations of others with Allah) even though they pray. The Prophet (blessings and peace of Allah be upon him) stated that, as was narrated by Ibn Majah (4204) from Abu Sa`id, who said: The Messenger of Allah (blessings and peace of Allah be upon him) came out to us when we were discussing the Dajjal (false messiah) and said: “Shall I not tell you of that which I fear more for you than the Dajjal?” We said: Yes. He said: “Hidden shirk, when a man stands to pray and makes it look good because he sees a man looking at him.”
Classed as sound (hasan) by al-Albani in Sahih Ibn Majah.
A person may fall into shirk whilst praying, whether he realizes it or not. In the answer to question no. 183713, we stated that if a person seeks worldly gain by doing a righteous deed and the hereafter does not cross his mind, his good deed is not valid and will not be accepted from him, unless he seeks Allah’s pleasure by doing it.
But if he does a righteous deed intending to seek benefits and reward both in this world and the hereafter, there is nothing wrong with that.
So whoever prays in order to show off, or so that it will be said of him that So-and-so prays regularly, and so that he will become known among people as a man of good character who prays regularly, or he prays to draw close to Allah so that He may answer his prayer and meet his needs, but when his needs are met he stops praying, or he prays so that his situation will improve, and when his situation does not improve he gives up prayer – in these cases he is not doing the action for the sake of Allah. Imam Ahmad (20715) narrated that Ubayy ibn Ka`b (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Give this ummah glad tidings that they will attain renown and high status, and Islam will prevail and be victorious, and they will attain power in the land. So whoever does for worldly gain that which should be done for reward in the hereafter will have no share of the hereafter.” Classed as authentic (sahih) by al-Albani in Sahih al-Jami` (2825).
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said:
Whoever prays in order to gain something, or gives the call to prayer in order to gain something, will have no share in the hereafter, because he sought worldly gain through his deed, so he will have nothing but what he sought.
End quote from Fatawa Nur `ala ad-Darb, 8/2.
The reason for that is that Allah, may He be Exalted, does not accept any deed unless it is righteous and done in pursuit of His pleasure. Muslim (2985) narrated that Abu Hurayrah said: The Messenger of Allah (blessings and peace of Allah be upon him) said: “Allah, may He be blessed and exalted, said: I am the least in need of a partner. Whoever does any deed in which he associates someone else with Me, I will reject him and his deed.”
Shaykh Ibn `Uthaymin (may Allah have mercy on him) said:
Sincerity to Allah in worship means that nothing motivates the individual to do acts of worship except love of Allah, may He be Exalted, veneration of Him and hope for His reward and good pleasure. Hence Allah, may He be Exalted, said of Muhammad the Messenger of Allah (blessings and peace of Allah be upon him):
{Muhammad is the Messenger of Allah; and those with him are forceful against the disbelievers, merciful among themselves. You see them bowing and prostrating [in prayer], seeking bounty from Allah and [His] pleasure} [Al-Fat-h 48:29].
End quote from Majmu` Fatawa wa Rasa’il al-‘Uthaymin (21/19).
So what is required of the Muslim is to turn to Allah, may He be Exalted, in his intention and his actions, seeking thereby Allah’s pleasure and the hereafter, and hoping that Allah will help him in his worldly affairs, so that he will have the means to fulfil his religious duties, as Allah, may He be Exalted, says:
{And seek help through patience and prayer} [Al-Baqarah 2:45].
Ibn Kathir (may Allah have mercy on him) said:
Allah, may He be Exalted, enjoins his slaves to seek help in attaining what they aspire to of goodness in this world and the hereafter through patience and prayer.
End quote from Tafsir Ibn Kathir, 1/251.
So the believer strives for the sake of Allah, and by default will also attain success in this life. This is one of the outcomes of his sincerity and righteous deeds, for Allah will grant him reward both in this world and the hereafter, as He, may He be Exalted, says:
{Whoever does righteousness, whether male or female, while he is a believer - We will surely cause him to live a good life, and We will surely give them their reward [in the Hereafter] according to the best of what they used to do} [An-Nahl 16:97].
Ibn Kathir (may Allah have mercy on him) said:
This is a promise from Allah, may He be Exalted, to the one who does righteous deeds, that Allah will cause him to live a good life in this world, and He will give him his reward in the hereafter according to the best of what he used to do. That good life includes everything that makes life easy in all aspects.
End quote from Tafsir Ibn Kathir, 4/601.
And Allah, may He be Exalted, says:
{And whoever fears Allah - He will make for him a way out
And will provide for him from where he does not expect} [At-Talaq 65:2-3].
At-Tirmidhi (2465) narrated that Anas ibn Malik (may Allah be pleased with him) said: The Messenger of Allah (blessings and peace of Allah be upon him) said: Whoever makes the hereafter his main concern, Allah will grant him contentment in his heart and give him peace of mind, and he will inevitably attain his goals in this world. But whoever makes this world his main concern, Allah will make him constantly fear poverty and will cause him to become anxious and worried, and he will attain nothing of his worldly goals except what was decreed for him.” Classed as authentic (sahih) by al-Albani in Sahih at-Tirmidhi.
As for the one who does righteous deeds seeking thereby reward in this world, he will gain nothing in this world accept what Allah has decreed for him, and he will fail in his actions and will be disappointed because he did not intend thereby to seek the pleasure of Allah, and everything that is not done with the intention of seeking the pleasure of Allah is in vain. Allah, may He be Exalted, says:
{Whoever seeks [the pleasures of] this present life, We hasten therein whatever We will for whomever We please. Then We decree for him hell, which he will enter, disgraced and rejected.
But whoever seeks the hereafter and strives for it as it should be striven for, and is a [true] believer – such are the ones whose effort will be appreciated} [Al-Isra’ 17: 18-19]
{Whoever desires the harvest of the Hereafter - We increase for him in his harvest. And whoever desires the harvest of this world - We give him thereof, but there is not for him in the Hereafter any share} [Ash-Shura 42:20].
Shaykh al-Islam Ibn Taymiyah (may Allah have mercy on him) said:
Unless an individual’s intention is righteous and his deeds are righteous and are done for the sake of Allah, his deeds are corrupt, as Allah, may He be Exalted, says: {verily your endeavours have divergent ends} [Al-Layl 92:4].
All these deeds are in vain, and are akin to the deeds of the disbelievers.
End quote from Majmu` al-Fatawa, 28/169.
Ibn al-Qayyim (may Allah have mercy on him) said:
Whoever seeks by his deeds something other than the pleasure of Allah and intends to do something other than draw close to Him and seek reward with Him has associated others with Him in his intention.
Sincerity means being sincere to Allah alone in one’s actions, words, will and intention. This is what pure monotheism is, the way of Ibrahim, which Allah has enjoined upon all His slaves, and He does not accept anything else from anyone. This is what Islam is.
{And whoever desires other than Islam as religion - never will it be accepted from him, and he, in the Hereafter, will be among the losers} [Al `Imran 3:85].
It is the way of Ibrahim, and whoever turns away from it is among the most foolish of the foolish.
End quote from Al-Jawab al-Kafi, p. 135.
So it may be said to those who pray so that their worldly needs will be met: Fear Allah in the way you worship Him, and fear Allah in order to protect yourselves. Realize that if a person strives to seek the pleasure of Allah, he will attain blessings both in this world and the hereafter, but if he strives for a purpose other than seeking the pleasure of Allah, aiming to attain transient worldly gains, he will not attain anything except what Allah has decreed for him, and his deeds will not earn him anything but loss in this world and the hereafter.
And it may be said to the one who apostatises from his religion or gives up prayer, worship and acts of obedience when he does attain what he wants, that he should beware lest he become one of those who worship Allah on the edge of faith; if something good comes to them they are content with it, but if something bad happens to them, they turn away. Allah, may He be Exalted, says:
{Among people there are some who worship Allah on the edge [of faith]. If something good comes to them, they are content with it, but if a trial befalls them, they make an about-face, thus forfeiting both this world and the hereafter. That is indeed manifest loss} [Al-Hajj 22:11].
Shaykh as-Sa`di (may Allah have mercy on him) said:
That is, among people there are some who are weak in faith; faith has not truly entered their hearts and they have never felt the joy of faith. {If something good comes to them, they are content with it} if provision continues to come easily, and they are not faced with any hardship, they are content with that life of ease, not with their faith. Allah may give such a person well-being and not put him through trials which could cause him to give up his religion.
{but if a trial befalls them} such as being faced with hardship or the loss of someone or something dear to them
{they make an about-face} that is, they apostatize and give up their religion.
{thus forfeiting both this world and the hereafter}.
End quote from Tafsir as-Sa`di, p. 534.
For more information, please see the answers to questions no. 14258 and 110715.
And Allah knows best.