Al-Anfal: 7
{And [remember] when}
The grammatical case is accusative, governed by an implied udhkur (remember).
{that it is for you}
This is a substitute (badal) for "one of the two parties."
The two parties: The caravan (al-‘īr) and the armed force (al-nafīr).
{the one without the thorn}
This refers to the caravan, for it had only forty horsemen. The "thorn" (al-shawka) was with the armed force due to their numbers and equipment. Al-shawka (the thorn) is the sharpness, metaphorically derived from the thorn of a plant. It is said, "the thorn of the spears" for their points. From this comes the expression "sharp-weaponed" (shā’ik al-silāḥ).
You wished for the caravan because it was the party that possessed no sharpness or intensity, and you did not want the other party.
{that He might establish the truth}
That He might confirm and exalt it.
{by His words}
By His signs revealed regarding fighting the party with the thorn, by what He commanded the angels regarding their descent for victory, and by what He decreed regarding their capture, killing, and casting into the pit of Badr.
{and cut off the root of the disbelievers}
Al-dābir (the root/last part) is an active participle from dabara (to turn back/retreat). From this comes the "tail" of a bird. "Cutting off the root" is an expression for total eradication.
It means: You desired the immediate benefit and the trivial matters, and not to encounter what would afflict your bodies and circumstances. But Allah, the Almighty and Exalted, desires the noble matters—that which pertains to the flourishing of the religion, the victory of the truth, the exaltation of the Word, and success in both abodes. How vast is the difference between the two desires!
Therefore, He chose for you the party with the thorn, broke their strength through your weakness, overcame their multitude with your fewness, honored you and humiliated them, and granted you that which the lesser—the caravan and what was in it—cannot compare to.
It is also recited as bi-kalimatihi (by His word) in the singular.
{That He might establish the truth and abolish falsehood, even if the criminals dislike it.}