Sayyidina Ali RA said:
“O son of Adam, when you see that your Lord, the Glorified, bestows His favours on you while you are disobeying Him, you should fear Him.”
When a person goes on receiving favours despite sinfulness he develops the misunderstanding that Allah is pleased with him and that this is the result of His pleasure, because increase in favours arises out of gratefulness and in the event of ungratefulness the bestowal of favours stops, as Allah says:
‘And when declared your Lord: “If you be grateful I will increase (My favours) to you, and if you be ungrateful, verily My torment is indeed severe.” (Qur’an 14:7)
Nevertheless, continuous bestowal of favours, despite disobedience and ungratefulness, cannot be the result of Allah’s Pleasure, nor can it be said that in this way Allah has put him under the misconception that he should regard this exuberance of favours as the result of Allah’s Pleasure because when he knows that he is a sinner and disobedient and is committing sins and vices, knowing them to be sins and vices, then there are no grounds for misconception on his part by assuming Allah’s Pleasure and Consent. He should rather think that this is a sort of trial and respite for when his sinfulness and high-handedness reaches its zenith he will be caught all at once. Therefore, in such a case he should keep waiting as to when Allah’s favours are taken away from him and he is punished with deprival and discomfiture.
From the book Nahjul Balagha.