
The Seal on Hearts:
“Khatamal laahu ‘alaa quloobihim” means “Allah (subhanahu wa ta’ala) has placed a seal on their hearts”.
In this verse Allah (subhanahu wa ta’ala) mentions hearts first because all the verses preceding this are matters of heart. For example, doubts, taqwa and imaan are all about the heart.

“Khatam” is a hard type of sealing. It is complete corking such that nothing can enter or escape with this type of sealing. For example, a bottle that would be sealed with wax in old times.
Figuratively “khatam” is used when something is a done deal i.e. there is no more work needed.
Unveiling the Seal – When Goodness Runs Out:
When Allah (subhanahu wa ta’ala) says that he placed a seal on their hearts, it means that all the goodness that their hearts could have exhibited has been exhausted. In other words, they didn’t exercise any of the good Allah (subhanahu wa ta’ala) put in their hearts and there is nothing left to show. So, Allah (subhanahu wa ta’ala) decides there is no more reason to give a chance to them and hence places a seal on their hearts.
Mujahid (a Tabi’i and a student of Ibn Abbas (radi allahu anhu)) demonstrated with his hand while saying, “They used to say that the heart is just like this – meaning the open palm. When the servant commits a sin, a part of the heart will be rolled up – and he rolled up his index finger. When the servant commits another sin, a part of the heart will be rolled up” – and he rolled up another finger, until he rolled up all of his fingers. Then he said, “Then, the heart will be sealed.”

Hadith from Jami’ At-Tirmidhi and Sunan Ibn Majah
Abu Hurairah (radi allahu anhu) narrated that: The Messenger of Allah (sallallahu alaihi wasallam) said: “Verily, when the slave (of Allah (subhanahu wa ta’ala)) commits a sin, a black spot appears on his heart. When he refrains from it, seeks forgiveness and repents, his heart is polished clean. But if he returns, it increases until it covers his entire heart. And that is the ‘Ran’ which Allah (subhanahu wa ta’ala) mentioned: ‘Nay, but on their hearts is the Ran which they used to earn.’”
The Consequences of Stubbornness:
In the previous ayat, we learnt that the people were stubborn. Allah (subhanahu wa ta’ala) never seals a heart until it shows stubbornness. People are responsible for what they do to their hearts. For example, a car is supposed to run on gasoline. If you put cooking oil and salt in it and say the car didn’t run because Allah (subhanahu wa ta’ala) didn’t want it to run, then its incorrect. That car is to be operated in a certain way. Yes, Allah (subhanahu wa ta’ala) didn’t make it run, but it wasn’t due to any divine intervention like lightning being struck etc. Allah (subhanahu wa ta’ala) didn’t make it run because you didn’t operate the car the way it should have been.
Accountability for Our Actions:
When human beings suffer physical consequences in this world, then we need to understand that there are certain things which are beyond our control but at the same time harmful things happen to us, because of us. For example, people don’t watch their diabetes or cholestrol, don’t eat healthy food, don’t exercise and then have an heart attack and say it is the qadr of Allah. This is incorrect.
The same principle of physical world applies in the spiritual world too. When we don’t exercise the strength of our hearts to accept a good message, when we don’t try and remember Allah (subhanahu wa ta’ala), when we don’t abide by the law of Allah (subhanahu wa ta’ala), when we keep forgetting Allah (subhanahu wa ta’ala) then there will be consequences on our hearts. If we show this attitude before Allah (subhanahu wa ta’ala) and be irresponsible, then Allah (subhanahu wa ta’ala) will allow it to be sealed.