Al-Imran: 155
"He caused them to slip" (استزلهم)
He sought from them the slip and invited them toward it.
"Because of some of what they earned" (ببعض ما كسبوا)
Meaning: Those who fled on the day of Uhud—the cause of their fleeing was that they had obeyed Satan and committed sins. Consequently, this prevented them from receiving divine support and the strengthening of their hearts, leading them to flee.
It is said: Satan’s causing them to slip is the fleeing itself. He invited them to it because of sins they had previously committed, for sin leads to sin, just as obedience leads to obedience and serves as a grace for it.
Al-Hasan (may Allah be pleased with him) said: He caused them to slip by making them accept the defeat he had beautified for them.
It is also said: "Because of some of what they earned" refers to their abandonment of the position where the Messenger of Allah (peace be upon him) had commanded them to remain firm, which dragged them into defeat.
Others said: He reminded them of those sins, so they disliked meeting Allah while carrying them, and thus they delayed the Jihad until they could rectify their affairs and fight in a state that was pleasing.
If you ask: Why was it said "some of what they earned"?
I say: It is like His saying, "And He pardons much" (Al-Ma'idah: 15).
"And Allah has already pardoned them"
Due to their repentance and their seeking of forgiveness.
"Indeed, Allah is Forgiving"
Of sins.
"Forbearing"
He does not hasten the punishment.
"O you who have believed, do not be like those who disbelieved and said about their brothers when they traveled through the land or went out to fight, 'If they had been with us, they would not have died or been killed,' so Allah makes that a regret within their hearts. And it is Allah who gives life and causes death, and Allah is Seeing of what you do. And if you are killed in the cause of Allah or die—then forgiveness from Allah and mercy are better than whatever they accumulate. And if you die or are killed, unto Allah you will be gathered."