عَنْ أَبِي سَعِيدٍ قَالَ لَمَّا كَانَ يَوْمُ بَدْرٍ ظَهَرَتْ الرُّومُ عَلَى فَارِسَ فَأَعْجَبَ ذَلِكَ الْمُؤْمِنِينَ فَنَزَلَتْ غُلِبَتِ الرُّومُ فِي أَدْنَى الْأَرْضِ وَهُم مِّن بَعْدِ غَلَبِهِمْ سَيَغْلِبُونَ فِي بِضْعِ سِنِينَ لِلَّهِ الْأَمْرُ مِن قَبْلُ وَمِن بَعْدُ وَيَوْمَئِذٍ يَفْرَحُ الْمُؤْمِنُونَ قَالَ فَفَرِحَ الْمُؤْمِنُونَ بِظُهُورِ الرُّومِ عَلَى فَارِسَ
Abu Sa’id رضیﷲ عنه reported: On the day of the battle of Badr, the Romans were victorious over the Persians and the believers were pleased by that. Allah had revealed, “The Romans were defeated in the nearest land, but they will be victorious after their defeat in a few years. To Allah belongs the matter before and after, and on that day the believers will rejoice,” (30:1-4). Thus, the believers rejoiced at the victory of the Romans over the Persians.
-Sunan Tirmidhi 2935, Al Albani رحمہ اللہ graded it Sahih.
These Ayat were revealed about the victory of Sabur, the king of Persia, over Ash-Sham (Greater Syria), the adjoining partisan states of the Arabian Peninsula, and the outlying regions of the land of the Romans.
Heraclius, the emperor of the Romans, was forced to flee to Constantinople where he was besieged for a lengthy period. Then Heraclius regained the upper hand. (the Persians were victorious during the first stages of the war, capturing much of the Egypt, Levant and even Anatolia. However, the coming to power of Heraclius ultimately drove to the Persians downfall.)
Imam Ahmad recorded that Ibn Abbas رضیﷲ عنه commented on this ayah and said:
The idolators wanted the Persians to prevail over the Romans, because they were idol worshippers, and the Muslims wanted the Romans to prevail over the Persians, because they were People of the Book.
-Tafsir Ibn Kathir 30/1-4
Ibn Taymiyah رحمہ اللہ said,
لَيْسَ الْعَاقِلُ الَّذِي يَعْلَمُ الْخَيْرَ مِنْ الشَّرِّ وَإِنَّمَا الْعَاقِلُ الَّذِي يَعْلَمُ خَيْرَ الْخَيْرَيْنِ وَشَرَّ الشَّرَّيْنِ
“The intelligent one is not he who knows good and evil. Rather, the intelligent one is only he who knows the better of two goods or the worst of two evils.”
-Majmu al Fatawa 20/54