You can see this clearly in ordinary life: when a human king discovers that someone in his entourage or among his servants is secretly longing to betray him—his heart and mind pre-occupied and filled with that wish, even while outwardly serving him and carrying out his tasks—the moment the king learns of his inner secret and intention he despises him to the utmost, hates him, and treats him as he deserves. That servant becomes more detestable to the king than a distant man who has committed some offense yet whose inner self remains loyal, harboring no desire, love, or eagerness for treachery. The first merely refrains from betrayal because he is unable or too busy, though his heart is brimming with it; the second actually commits the wrongdoing, but his heart hates it, conceals no treachery, and does not persist in it. The latter, therefore, is in a better state and faces a safer outcome than the former.
To sum up: the heart is never vacant of thought. It is occupied either with what the Afterlife obliges and its benefits, with the interests of one’s worldly life and livelihood, or with whisperings, false hopes, and imagined suppositions.
We have already likened the soul to a mill that turns with whatever is thrown into it: if you throw in grain, it turns with grain; if you throw in glass, pebbles, or dung, it turns with those. Allah—exalted is He—is the guardian, owner, and disposer of that mill. He has appointed for it an angel who casts into it what benefits it, so it turns with that, and a devil who casts into it what harms it, so it turns with that as well. The angel approaches it at one time and Satan approaches it at another. The grain the angel casts is a promise of good and an affirmation of the true pledge; the grain Satan casts is a threat of evil and a denial of that pledge. The flour produced is in proportion to the grain dropped in. The bearer of harmful grain can only throw it in when he finds the mill empty of beneficial grain and its custodian has neglected and turned away from it; only then does he hasten to dump what he has into it.
In short, when the custodian of the mill abandons it—failing to tend it and to pour in wholesome grain—the enemy gains access to corrupt it and set it turning with whatever he brings.