In The Name of Allaah, The Most Merciful, The Bestower of Mercy.
Shaikh Uthaymeen [rahimahullaah] said: If someone says, ‘’We perform the five daily prayers, and the optional prayers as much as Allaah wills for us, yet we do not find in our hearts that which forbids us from wicked and evil deeds, and Allaah did say: [إِنَّ ٱلصَّلَوٰةَ تَنۡهَىٰ عَنِ ٱلۡفَحۡشَآءِ وَٱلۡمُنكَرِۗ – Verily, As-Salat (the prayer) prevents from Al-Fahsha’ (i.e. great sins of every kind) and Munkar (every kind of evil wicked deed, etc.)] [Surah Al-Ankabut. Aayah 45]. This is an established statement, therefore what is the answer to the question?
The answer: Indeed, the intent behind the prayer – the perfect prayer- is the one that is [performed in the manner] commanded by Allaah and His Messenger- far removed from [the thoughts, deeds etc] forbidden by Allaah and His Messenger [whilst in the prayer].
The most important affair is Khushoo and that one’s heart is attentive, which is the substance and essence of the prayer. If a person has Khushoo and his heart is attentive, this will have an effect after the prayer. His heart will be upright and will return to its previous state [i.e. the attentiveness one had in the presence of Allaah] – whilst he was praying- due to love of Allaah, hoping for Allaah’s Mercy and Fearing Allaah’s Punishment; (as opposed to) when we begin the prayer – and we ask Allaah to forgive us – and straight away one is obstructed by whispers [i.e. shaytaan’s whispers and thoughts that diverts one from the prayer] and when he attempts to repel it, the whispers are flung into his heart- just as a stone is thrown into water – and completely occupies his mind; then a second whisper follows and obstructs his heart, and then another one! Therefore, I exhort myself and every Muslim to [strive] to attain Khushoo and an attentive heart [in the prayer], for indeed that will aid a person to achieve the [good] outcomes of the prayer; rather we’ll attain the praiseworthy and beautiful [outcomes] of the prayer.
[An Excerpt from ‘At-Ta’leeq Alaa As-Siyaasah Ash-Shar’iyyah’. Page 69. Slightly paraphrased]