Allah is His mercy, and His mercy is near to the doers of good who have fulfilled His command to call upon Him humbly and in private, with fear and hope. He thus established that what you seek from Him—mercy—is commensurate with your fulfillment of what He requires of you. If you do good, you do good for yourselves.
His words, Exalted is He:
“Indeed, Allah’s mercy is near to the doers of good,”
convey meaning through their explicit wording, through the causal relationship they suggest, and through their implication. Their explicit wording indicates that mercy is near to those who do good. The causal relationship they suggest indicates that this nearness is merited through doing good, which is the reason mercy is near to them. Their implication indicates that mercy is far from those who do not do good. These, then, are three meanings conveyed by this statement.
Those who do good are singled out for the nearness of mercy because mercy is an act of goodness from Allah, Mighty and Majestic, the Most Merciful of those who show mercy. His goodness, Blessed and Exalted is He, is bestowed only upon those who do good, for recompense corresponds to deeds. Whenever they do good through their deeds, He does good to them through His mercy. As for someone who is not among those who do good, his distance from goodness causes mercy to be distant from him: distance is met with distance, and nearness with nearness. Whoever draws near to Him by doing good, Allah draws near to him with His mercy; and whoever distances himself from doing good, Allah distances His mercy from him.
Allah, Glorified is He, loves those who do good and hates those who are not among them. For anyone Allah loves, His mercy is the nearest thing to him; while for anyone Allah hates, His mercy is the furthest