Surah: 008 Al-Anfal
Surah Al Anfaal was revealed immediately following the victory of Battle of Badr, the first confrontation between the Muslims and the disbelievers of Quraysh, thereby it’s a relatively early Madni surah. The victory itself presented a problem with respect to the distribution of the war booty since such an issue has occurred for the very first time in the newly formed Muslim state. The norm among the people of that age was that whoever collected any article from the enemy, then it belonged to him, but this resulted in a dispute among factions of the Muslim army, as those who standing guard behind or still fighting off the enemies did not get the opportunity to collect any article and so were unfairly deprived of any material gains. To immediately put an end to the conflict, Allaah (SWT) firstly revealed that whatever booty they won actually belong to Allaah (SWT) and His Messenger ﷺ.
Historically, any war booty that was won by the followers of a previous prophet, it was never permissible for them to consume it. It is one of the distinguishing features of the Prophet ﷺ that the war booty was made permissible for him and his followers. But the distribution of any such material gain was to be made in the way ordained by Allaah (SWT), ensuring that the deprived sections of the society benefitted as well as the soldiers participating in the battle were adequately compensated.
The circumstances that led to the Battle of Badr are described wherein the Muslims had set out to intercept a trade caravan of the Quraysh, but ended up in a deadly confrontation with them. The Muslims wanted to avoid the situation of fighting with the mighty army of Quraish against whom they were severely outnumbered and appeared to be fighting a lost battle. But Allaah (SWT) had decreed victory for the believers, and they were aided by angels from the heavens and the Quraish ended up suffering heavy losses in this battle.
The broader message in this surah is to emphasize that the point of engaging in war should not be to win riches, but rather to establish Islam and extend justice to all regions by allowing them to govern by the Book of Allaah (SWT). War is not something liked but is still sometimes necessary to establish harmony, and so it must be governed by the rules outlined by Allaah (SWT) to ensure justice.