Surah Al-Anfaal
فَلَمْ تَقْتُلُوهُمْ وَلَٰكِنَّ ٱللَّهَ قَتَلَهُمْ ۚ وَمَا رَمَيْتَ إِذْ رَمَيْتَ وَلَٰكِنَّ ٱللَّهَ رَمَىٰ ۚ وَلِيُبْلِىَ ٱلْمُؤْمِنِينَ مِنْهُ بَلَآءً حَسَنًا ۚ إِنَّ ٱللَّهَ سَمِيعٌ عَلِيمٌۭ
“And you did not kill them, but it was Allah who killed them. And you threw not, [O Muhammad], when you threw, but it was Allah who threw that He might test the believers with a good test. Indeed, Allah is Hearing and Knowing.”
Translation: Saheeh International
Reflection — Ibn Kathir
Allah's Signs displayed during Badr, And throwing Sand in the Eyes of the Disbelievers
Allah states that He creates the actions that the servants perform and that whatever good actions they take, it is He Who should be praised for them, for He directed and helped them perform these actions. Allah said,
فَلَمْ تَقْتُلُوهُمْ وَلَـكِنَّ اللَّهَ قَتَلَهُمْ
Reflection — Maarif ul Quran
This great victory was achieved by Muslims in the background which was initially full of dismay and hopelessness. So, when they returned from the battlefield, they started talking about it. The Companions ؓ got busy relating their deeds on the battlefield. Revealed thereupon was this verse: فَلَمْ تَقْتُلُوهُمْ وَلَـٰكِنَّ اللَّـهَ قَتَلَهُمْ (So, you did not kill them, but Allah killed them -17) through which they were instructed not to wax proud over their effort and deed, for that which happened there was not simply the outcome of their personal effort and deed. In fact, it was purely and simply the fruit of the help and support given by Allah Ta` ala - and the enemies killed at their hands were not really killed by them, rather, they were killed by Allah Ta` ala.
Similarly, addressing the Holy Prophet ﷺ , it was said: وَمَا رَمَيْتَ إِذْ رَمَيْتَ وَلَـٰكِنَّ اللَّـهَ رَمَىٰ (And you did not throw when you threw, but Allah did throw). It means that the specific outcome of the act of throwing, whereby it would reach the eyes of every fighting man in the enemy force and frighten them all, was not the direct effect of 'his' throwing. It was, in fact, the perfect power of Allah Ta’ ala which generated the format of this situation. To quote Rumi for a chic poetic explanation:
What does this verse bring up for you today?