إن يمسسكم قرح فقد مس القوم قرح مثله
If a wound has touched you, be sure a similar wound has touched the others,
Therefore, the Ayah says, if you suffered injuries and some of you were killed, then your enemies also suffered injuries and fatalities.
وتلك اﻻيام نداولها بين الناس
And so are the days, that We give to men by turns,
and at times -- out of wisdom -- We allow the enemy to overcome you, although the final good end will be yours.
وليعلم الله الذين آمنوا
and that Allah may know (test) those who believe,
According to Ibn Abbas,
meaning, "So that We find out who would be patient while fighting the enemies.''
ويتخذ منكم شهداء
and that He may take martyrs from among you.
those who would be killed in Allah's cause and gladly offer their lives seeking His pleasure.
والله ﻻ يحب الظالمين