Abu Hurairah [RA] reported:
Messenger of Allah [SAWS] said, “Should I not direct you to something by which Allah obliterates the sins and elevates your ranks.”
They said: “Yes, O Messenger of Allah”.
He said, “Performing Wudu’ properly, even in difficulty, frequently going to the mosque, and waiting eagerly for the next Salat (prayer) after a Salat is over; indeed, that is Ar-Ribat“.
Ribat means staying on the frontier of an Islamic country, for security and defense purposes. Thus, it is a continuous process of Jihad.
Continuous good deeds and `Ibadah have been compared with Ribat. Performing full ablution in Makarih (where severe unpleasantness and hard labour is involved) is quite difficult. For instance, in winter it is very cumbersome to properly wash all the organs of the body but a Muslim does it to please Allah. Thus, its reward will be more in proportion to the labour.
Similarly, the nearness of a mosque is in many respect very useful but its being far from the house is better in this respect that the greater distance one has to cover for going to the mosque, the higher the reward for going there will be. Those who live close to the mosque do not have this credit.