The Commander of the Believers, Abu Hafs ‘Umar ibn al-Khattāb (may Allah be pleased with him) reported: I heard the Messenger of Allah (ﷺ) say:
"Verily, the reward of deeds depends on intentions, and each person will be rewarded according to what he intended. So, he whose emigration is for the sake of Allah and His Messenger, his emigration will be for the sake of Allah and His Messenger, and he whose emigration is to achieve some worldly gain or take some woman in marriage, his migration will be for what he has migrated for."
Reported by Al-Bukhari (No. 1, 54, 2529, 3898, 5070, 6689, 6953), Muslim (No. 1907a, 1907b), Abu Dawud (No. 2201), At-Tirmidhi (No. 1647), An-Nasa’i (No. 75, 3437, 3794), Ibn Majah (No. 4227) and Ahmad (No. 163, 283).
The Prophet (may Allah's peace and blessings be upon him) explains that all deeds are considered according to the intention behind them. This ruling generally applies to all deeds, including acts of worship and dealings. So, he who seeks by his deed some worldly benefit will attain that benefit and will not be rewarded for it. And he who performs a deed with the intention to draw close to Allah Almighty will be rewarded, even if his deed is an ordinary one, like eating and drinking.
Then, the Prophet (may Allah's peace and blessings be upon him) provided an example to illustrate the impact of intention while both deeds apparently look equal. He pointed out that if a person migrates and leaves his homeland with the intention to win the pleasure of his Lord, his migration is a Shar‘i and accepted one, for which he will be rewarded, given his sincere intention; and if a person migrates to attain some worldly benefit, like wealth, high standing, business, or a wife, he will not attain anything from his migration except what benefit he intended, and no reward will be given to him.
Lessons
The Hadīth urges us to be sincere, for Allah only accepts the deeds that are intended for His sake.
If a legally accountable person performs the deeds that are to be done to gain Allah's pleasure by way of habit, he will only be rewarded for them if he intends to draw close to Allah Almighty by doing them.
The intention serves to distinguish between acts of worship themselves and also separates acts of worship from habits.
Explanation in Arabic
يُبَيِّنُ النبيُّ صلى الله عليه وسلم أنَّ كل الأعمال معتبرة بالنية، وهذا الحكم عام في جميع الأعمال من العبادات والمعاملات، فمن قصد بعمله منفعةً لم يَنَلْ إلا تلك المنفعة ولا ثواب له، ومن قصد بعمله التقرب إلى الله تعالى نال من عمله المثوبة والأجر ولو كان عملًا عاديًّا، كالأكل والشرب.
ثم ضرب صلى الله عليه وسلم مثلًا لبيان تأثير النية في الأعمال مع تساويهما في الصورة الظاهرة، فبَيَّن أنَّ من قصد بهجرته وترك وطنه ابتغاء مرضات ربه، فهجرته هجرة شرعية مقبولة يثاب عليها لصدق نيته، ومن قصد بهجرته منفعةً دنيوية، من مال، أو جاه، أو تجارة، أو زوجة، فلا ينال من هجرته إلا تلك المنفعة التي نواها، ولا نصيب له من الأجر والثواب.
الحث على الإخلاص، فإن الله لا يقبل من العمل إلا ما ابتُغي به وجهه.
الأعمال التي يُتَقَرَّبُ بها إلى الله عز وجل إذا فعلها المكلف على سبيل العادة ليس له ثواب عليها، حتى يقصِدَ بها التقرب إلى الله.
النية يفرق بها بين العبادات بعضها عن بعض وأيضًا العبادات عن العادات.
"Verily, the reward of deeds depends on the intention, and a person will be rewarded according to what he intended. So, he whose migration is for the sake of Allah and His Messenger, then his migration is for the sake of Allah and His Messenger, and he whose migration is to achieve some worldly…
" إنما الأعمال بالنيات، وإنما لكل امرىء ما نوى فمن كانت هجرته إلى الله ورسوله فهجرته إلى الله ورسوله، ومن كانت هجرته لدنيا يصيبها، أو امرأة ينكحها فهجرته إلى ما هاجر إليه"
Narrated by Umar ibn al-Khattāb
AuthenticMuttafaq ‘alayh (Bukhari and Muslim)Mishkat al-Masabih 1