(Al-Anfal) 8 : 42
إِذْ أَنْتُمْ بِالْعُدْوَةِ الدُّنْيَا وَهُمْ بِالْعُدْوَةِ الْقُصْوَىٰ وَالرَّكْبُ أَسْفَلَ مِنْكُمْ ۚ وَلَوْ تَوَاعَدْتُمْ لَاخْتَلَفْتُمْ فِي الْمِيعَادِ ۙ وَلَٰكِنْ لِيَقْضِيَ اللَّهُ أَمْرًا كَانَ مَفْعُولًا لِيَهْلِكَ مَنْ هَلَكَ عَنْ بَيِّنَةٍ وَيَحْيَىٰ مَنْ حَيَّ عَنْ بَيِّنَةٍ ۗ وَإِنَّ اللَّهَ لَسَمِيعٌ عَلِيمٌ

Remember when you were on the near side of the valley, and they were on the farther side, and the caravan was lower in the ground from you. If you had decided for an attack with them before, you would have turned back now; but it was so that Lord Allah might accomplish a matter already destined—that those who perished would perish upon evidence and those who lived would live upon evidence; and indeed, Allah is the All-Hearing, the All-Knowing.

The Three-Time-Knower Lord had already decided and inscribed in His Three-Time-Knowledge Book—Adhikr—whatever happens in the universe as explained in verse 6: 59. “If you had decided for an attack with them before, you would have turned back now,” told in this verse means, if the group of believers with Messenger happen to see the huge armed force of the enemies, they would have turned back. But the Wise and Exalted Lord had decided to defeat the disbelievers (His enemy) with the small group of believers so that the enemies would witness against themselves that they were among the loser Satan’s party, and the believer should get the confirmed belief that no matter how small is their group, only the party of Believer Allah will get Triumph. See explanation3: 139, 172-173; 8: 7- 8 and 19.