This verse clarifies the geographical settings of the Battle of Badr.
(…بِالْعُدْوَةِ..) (on the near side): This refers to the bank of the valley and its side, which is an elevated place.
(…الدُّنْيَا…) (on the near side of the valley): The feminization (using the feminine form) of the Arabic phrase to mean (the nearer), meaning, the one that is nearer to the city of al-Madinah.
(…وَهُم بِالْعُدْوَةِ الْقُصْوَىٰ…) (and they were on the farther side): Meaning the polytheists were on the other, farther side of am-Madinah.
…وَالرَّكْبُ أَسْفَلَ مِنكُمْ…) ) (And the caravan was lower [in position] than you): The caravan, which carried the merchandise of the Quraysh was in a place lower than where you were, near the coast of the Red Sea.
(…وَلَوْ تَوَاعَدتُّمْ لَاخْتَلَفْتُمْ فِي الْمِيعَادِ…) (If you had made an appointment [to meet], you would have missed the appointment): If there were an appointed time between you and them to fight, then when you knew about their great number and your few numbers, you would refrain from meeting them.
…وَلَٰكِن لِّيَقْضِيَ اللَّهُ أَمْرًا كَانَ مَفْعُولًا…)) (But [it was] so that Allah might accomplish a matter already destined): This arrangement and meeting occurred to fulfill the command of Allah (swt) already destined. Allah (swt) is capable of everything; when He says to something ‘Be,’ it is, and He is effective in whatever He wills. Allah’s command here was to complete the first armed encounter between the believers and the polytheists at Badr.
(لِّيَهْلِكَ مَنْ هَلَكَ عَن بَيِّنَةٍ وَيَحْيَىٰ مَنْ حَيَّ عَن بَيِّنَةٍ… ۗ ) (that those who perished [through disbelief] would perish upon evidence and those who lived [in faith] would live upon evidence): Here, the intended meaning is not physical life and death in the ordinary sense, but rather, it refers to spiritual life and death.
(…لِّيَهْلِكَ…) (that those who perished): Meaning to perish in his tyranny and polytheism. Therefore, Allah (swt) made a distinction between the group of believers and the group of disbelievers, and the matters were clear and evident.