Not for thee, (but for Allah), is the decision: Whether He turn in mercy to them, or punish them; for they are indeed wrong-doers.
To Allah belongeth all that is in the heavens and on earth. He forgiveth whom He pleaseth and punisheth whom He pleaseth; but Allah is Oft-Forgiving, Most Merciful.
A message of comfort to the Prophet, peace be upon him
This verse is addressed to the Prophet, peace be upon him. The attitude and behaviour of the hypocrites in this battle that left such an adverse effect on Muslims, was no less shocking to him. Allah has, in these words, consoled him that in this matter he neither had any power to intervene nor any responsibility for their behaviour and attitude. He had fully done his duty and if some of the groups still wronged their own selves, he need not worry about them. Leave their affair to Allah. If He wills, He will grant them an opportunity to repent and mend their ways, in which case He will forgive them. And if they are not eligible for His forgiveness, He will punish them. All power and authority in the heavens and earth rests with Him, to forgive or to punish whosoever He wishes. The reference at the end to the two attributes of Allah being most Forgiving and ever Merciful indicates that He will punish only those who really and truly deserve to be punished.
Islahi, Amin Ahsan. Pondering Over The Qur’an: Surah Ali Imran (p. 238). Islamic Book Trust. Kindle Edition.