The Almighty mentions what happened in the Battle of Badr, which was the first armed clash between the camp of faith and the camp of polytheism, disbelief and misguidance led by Abu Jahl and Abu Sufian. There were no more than three hundred men along with Prophet Muhammad (saws). This very little number were recruited by the Prophet (peace be upon him) to retake part of their money and merchandise that had been stolen from them when the Muslims were forced out of their homes. So, it is very normal and logical that the larger group defeat the smaller one. The polytheists outnumbered the Muslims by three folds. Moreover, the former had more weapons than the latter. Anyway, Allah (swt) is giving a moral out of that battle which differentiated the right from the wrong:
(… قَدْ كَانَ لَكُمْ آيَةٌ ) (Already there has been for you a sign …): A sign here indicates a ‘wonder.’
(… فِئَةٌ تُقَاتِلُ فِي سَبِيلِ اللَّهِ …) (…one fighting in the cause of Allah …): Fighting in the cause of Allah is defined by Prophet Muhammad (saws) as defending one’s honor, family, fortune, and home against aggression.
(… وَأُخْرَىٰ كَافِرَةٌ …) (…and another of disbelievers…): This complement part of the sentence could have been (and another of disbelievers fighting in the cause of the devil). Yet, this part is deleted. Here, the opposite of what’s in one sentence is not mentioned in the second and left to be understood from context. No doubt, the polytheists of Quraysh fighting against the Prophet (saws) were fighting in the cause of the devil.
(… يَرَوْنَهُم مِّثْلَيْهِمْ رَأْيَ الْعَيْنِ …) (…They saw them [to be] twice their [own] number by [their] eyesight …): Which group saw the other to be double their number by eyesight? The believers or the polytheists? The former is three hundred whereas the latter is one thousand. We know, of course, that the Almighty speaks about the Battle of Badr:
{إِذْ يُرِيكَهُمُ اللَّهُ فِي مَنَامِكَ قَلِيلًا ۖ وَلَوْ أَرَاكَهُمْ كَثِيرًا لَّفَشِلْتُمْ وَلَتَنَازَعْتُمْ فِي الْأَمْرِ وَلَٰكِنَّ اللَّهَ سَلَّمَ ۗ إِنَّهُ عَلِيمٌ بِذَاتِ الصُّدُورِ}
(And know that anything you obtain of war booty – then indeed, for Allah is one fifth of it and for the Messenger and for [his] near relatives and the orphans, the needy, and the [stranded] traveler, if you have believed in Allah and in that which We sent down to Our Servant on the day of criterion – the day when the two armies met. And Allah, over all things, is competent.) (Al-Anfaal: 43)
So, the eyesight can go for both parties. On one hand, the polytheists may have seen Muslims double of their number as Allah (swt) made them fear the Muslims; on the other hand, the Muslims saw the polytheists double their number so that they have the courage to fight them. In all, the Almighty has not stated who (They saw them [to be] twice their [own] number by [their] eyesight.) were.
(… وَاللَّهُ يُؤَيِّدُ بِنَصْرِهِ مَن يَشَاءُ …) (…But Allah supports with His victory whom He wills …): Here is the good news: victory comes from the Almighty without a doubt. The Almighty has stated here His absolute will and capacity. Still, He has stated, in other verses who deserves to get victory from Allah:
{ وَلَيَنصُرَنَّ اللَّهُ مَن يَنصُرُهُ}
(And Allah will surely support those who support Him.) (Al-Hajj: 40) And
{وَكَانَ حَقًّا عَلَيْنَا نَصْرُ الْمُؤْمِنِينَ}
(and incumbent upon Us was support of the believers.) (Ar-Room: 47)
(… إِنَّ فِي ذَٰلِكَ لَعِبْرَةً …) (…Indeed in that is a lesson …): There is a lesson here:
{فَاعْتَبِرُوا يَا أُولِي الْأَبْصَارِ}
(So take warning, O people of vision.) (Al-Hashr: 2)
And change your thought because the disbelievers had all the reasons to claim victory: number of soldiers and arms. the believers, however, have less number of soldiers and arms; so their victory is contrary to reason. Here is the lesson. You change your thought, forget about logical reasons and think of the Creator.
( لِّأُولِي الْأَبْصَارِ … ) (…for those of vision): ‘vision’ is related to eyesight, while ‘insight’ is related to the mind and heart. The almighty here says: (for those of vision.) and (for those of insight) because he is talking about a visual incident taking place before their eyes: the smaller group defeated the larger one by consent of Allah (swt).