Allah (swt) mentions in Surah Al Baqarah chapter 2 verses 6 and 7
"As to those who reject Faith, it is the same to them Whether thou warn them or do not warn them; they will not believe.
Allah hath set a seal on their hearts and on their hearing, and on their eyes is a veil; great is the penalty they (incur)."
These verses do not refer to common Kuffar who reject faith. The Arabic words used are al-lazina kafaroo, those who are bent on rejecting the truth. It will not make any difference to such people whether you warn them or not, they will not believe. Allah has set a seal on their hearts and on their hearing and on their eyes is a veil. It is not because Allah has set a seal on their hearts that these kuffar do not understand and believe, but it is the vice-versa. It is because these kuffar are bent on rejecting the truth and whether you warn them or not they will not believe, that Allah has set a seal on their hearts. Therefore Allah is not to blame, but these kuffaar who are bent on rejecting the faith are responsible.
2. Example of teacher predicting a student will fail
Suppose an experienced teacher, before the final examinations, predicts that a particular student will fail in the exams, since the student is very mischievous, not attentive in class and does not do his homework. If after the student appears for the examination, he fails, who is to be blamed for the student failing: the teacher or the student? Just because the teacher predicted, it does not mean that the teacher is to be blamed but the student himself is responsible for his failure.
Similarly Allah (swt) knows in advance that there are some people who are bent on rejecting the faith and Allah has put a seal on their hearts. Thus these non-Muslims themselves are responsible for rejecting the faith and not Allah (swt).