Surah Aal-i-Imraan

3:127

لِيَقْطَعَ طَرَفًۭا مِّنَ ٱلَّذِينَ كَفَرُوٓا۟ أَوْ يَكْبِتَهُمْ فَيَنقَلِبُوا۟ خَآئِبِينَ

That He might cut down a section of the disbelievers or suppress them so that they turn back disappointed.

Tafsir 3:127

Your victory in the Battle of Badr was because Allah willed that a group of the disbelievers be destroyed, and another be humiliated, frustrating them through defeat so that they withdrew.