Islam is the only religion which has a large part of worship dedicated to cleanliness and hygiene. Since ritual and physical purity are prerequisites to Prayer, we must properly understand it before going into the details of prayer. Islam teaches that purity is half of faith. The Prophet said: “Purity is half of faith.” (At-Tirmidhi)
Here purity is referring to all aspects of the word whether it be physical, spiritual, or mental. When talking about the purity required in order to perform the Prayer, we generally focus on the physical meaning although the mental and spiritual aspects are there. For example- when one makes ablution or washes as a result of following the message of Allah, then this is a spiritual builder of submission to Allah and His will for us.
In other cases when one may be tired, their mind was wandering or was busy in some daily activity then the purification acts as a mental preparation for the Prayer. Before talking about the different aspects of purity which enable one to pray, we must remember that physical purification is a necessity which must be clearly covered prior to performing the Prayer.
The Prophet (peace be upon him) said: “The key to the Prayer is purity, saying Allahu Akbar and raising one’s hands saying Allahu Akbar is its beginning point and saying As-salamu alaikum wa rahmatullah while turning one’s head to the right is its finality.” (At-Tirmidhi)
Source: Quoted with slight modifications from Yahya Ederer’s An Introduction to Prayer In Islam.