what he wishes to do necessarily intends it and has it as his purpose. It is impossible for a person knowingly to perform an act of his own free choice without willing it. Thus, when someone leaves his home knowing that he wishes to pray, it is impossible for him not to intend the prayer or have it as his purpose.
Likewise, if someone knows that tomorrow is a day of Ramadan and is someone who observes its fast, it is impossible for him not to intend to fast.
Similarly, when someone takes water knowing that his purpose is ritual purification, it is impossible for him not to intend it.
An absence of intention is conceivable only when someone is unaware of the act being performed, or when the prescribed act is not his aim. For example, someone may think that the prescribed time for prayer or fasting has passed, and so fast or pray believing that he is making it up after its time. Such a person has intended to make it up. If he subsequently discovers that his fasting and prayer actually took place within their prescribed time, then his prayer and fasting discharge his obligation, without dispute.
Likewise, someone who washes himself with water to remove dirt or to teach someone else has not intended, through that act, the prescribed ritual purification. Hence, the jurists have differed over the validity of prayer performed with such purification, and similar cases.
For this reason, a Muslim senses within himself a difference between the night before Eid, when he knows that he will not fast the following day, and the nights of Ramadan, when he knows that he will fast. He also senses the difference between being resident or travelling while intending to fast, and travelling without intending to fast.