Abbas - Tanwîr al-Miqbâs min Tafsîr Ibn ‘Abbâs
(Had Allah Known of any good) felicity (in them) i.e. in the Banu 'Abd al-Dar (He would have made them hear) He would have honoured them with faith, (but had He made them hear) had He honoured them with faith (they would have turned away) from faith due to Allah's foreknowledge about them, (averse) they are disbelieving in it.
For had God known of any good in them, any righteousness, were they to listen to the truth, He would have made them hear, in such a way as to understand; and had He made them hear — hypothetically speaking — already knowing that there is no good in them, they would have turned away, from it, averse, to accepting it, out of obstinacy and in denial.
For had God known of any good in them, or any righteousness, that is, any preparedness to receive the perfection of their hearing, so that they might then understand, accept and be obedient [He would have made them hear]; and had He made them hear, despite the absence of any good in them, so that they came to understand, their understanding would [even then] have no effect in terms of [subsequent] volition and obedience, nay, they would have turned away quickly, since that understanding in them would be an accidental matter, something that would be quick to disappear, and not essential [in them]; being averse, in their essence, such that understanding and volition would not remain in them long, as the Commander of the Believers [ʿAlī], may God be satisfied with him, said, 'Seek wisdom, even if it should be from the hypocrites, for wisdom keeps faltering in the breast of the hypocrite until it comes to rest alongside its companions in the breast of the believer'. In other words, it [wisdom] cannot fix itself in his [the hypocrite's] breast since here it is accidental and does not correspond with his essence.
(And be not like those who say: "We have heard,'' but they hear not.)
Ibn Ishaq said that this Ayah refers to the hypocrites, who pretend to hear and obey, while in fact they do neither. Allah declares that these are the most wicked creatures among the Children of Adam,
إِنَّ شَرَّ الدَّوَابِّ عِندَ اللَّهِ الصُّمُّ
(Verily, the worst of living creatures with Allah are the deaf) who do not hear the truth,
(and the dumb) who cannot comprehend it,
الَّذِينَ لاَ يَعْقِلُونَ
(who understand not. ) These indeed are the most wicked creatures, for every creature except them abide by the way that Allah created in them. These people were created to worship Allah, but instead disbelieved. This is why Allah equated them to animals, when He said,
(They are like cattle, nay even more astray; those! They are the heedless ones.) 7:179
It was also said that the Ayah (8:22) refers to some of the pagans of Quraysh from the tribe of Bani `Abd Ad-Dar, according to Ibn `Abbas, Mujahid and Ibn Jarir. Muhammad bin Ishaq said that this Ayah refers to hypocrites, as we stated. There is no contradiction here, because both disbelievers and hypocrites are devoid of sound comprehension, in addition to having lost the intention to do good. Allah states here that such are those who neither have sound understanding nor good intentions, even if they have some type of reason,
(Had Allah known of any good in them, He would indeed have made them listen.)
He would have helped them understand. However, this did not happen because there is no goodness in such people, for Allah knows that,
(even if He had made them listen...) and allowed them to understand,
(they would but have turned...), intentionally and out of stubbornness, even after they comprehend,
(with aversion.), to the truth.
Maududi - Sayyid Abul Ala Maududi - Tafhim al-Qur'an
This exposes the attitude of the hypocrites, who heard the Truth with their ears, yet did not accept and believe in it: they professed to believe but did not obey the Commands.
That is, "Those who do not listen to the Truth and do not utter it with their tongues, are deaf and dumb concerning the Truth."
As those hypocrites had no love for the Truth and no desire to work in its cause, they would have turned their backs from the Battle at the first critical juncture, even if Allah had helped them to obey the Command and march to the battlefield. Thus their company would have proved to be harmful rather than useful.