He guides whom He wills, shielding and curing them as a pure favour; and He leads astray whom He wills, abandons and tests them as an act of justice.
When news reached the Prophet (may Allah bless him and grant him peace) that some people were saying, “Whatever Allah wills and Muhammad wills,” he rejected it and said, “Say: Whatever Allah wills, and then whatever Muhammad wills.” By using thumma (“then”), which denotes sequence and a temporal gap, he placed his own will after Allah’s will, instead of joining the two with the particle wa (“and”), which would imply equality.
Allah—glorified is He—guides whom He wills and misguides whom He wills; this occurs by His decree and pre-ordination. Yet He guides those whom He knows to be fit for guidance—those who earnestly seek it and turn toward it—for Allah eases such people toward what is easy. Conversely, He leads astray whomever He wills because they turn away from seeking guidance and goodness; thus Allah lets them stray as a punishment for their aversion and unwillingness to pursue good.
This is made clear by His words: “As for him who gives, is mindful of Allah, and affirms the Ultimate Good, We shall ease him toward ease” (al-Layl 92:5–7). Here the cause comes from the servant, while the decree is from Allah. And He says: “But as for him who is stingy, deems himself self-sufficient, and denies the Ultimate Good, We shall ease him toward hardship” (al-Layl 92:8–10). Again, the cause lies with the servant and the decree with Allah—yet Allah decrees it as a punishment for him.
Thus Allah’s ordaining of guidance is a gracious favour: He honours the person who desires good and seeks guidance by making goodness and the performance of it easy for him. This is for the servant’s own benefit, not for Allah’s. As for His leading the misguided to stray, that is pure justice on His part—a recompense for their turning away and their refusal to pursue what is good.