[Machine] The Messenger of Allah ﷺ went out to Badr and encountered the enemy there. When Allah granted him victory, a group of Muslims followed the retreating enemy and killed them. Another group focused on the spoils of war and the captives, while another group claimed that they were more entitled to the spoils than others. Those who defended the Prophet ﷺ said, "No, he belongs to us. We were more concerned about protecting the Prophet ﷺ from the enemy." Those who focused on the spoils and captives also claimed that they were more entitled to them. They said, "No, he belongs to us. We were the ones who took control and safeguarded him." Then Allah revealed the verse, "They ask you about the spoils of war. Say, 'The spoils of war belong to Allah and the Messenger.'" The Messenger of Allah ﷺ then divided the spoils among the companions fairly.
خَرَجَ رَسُولُ اللهِ ﷺ إِلَى بَدْرٍ فَلَقِيَ بِهَا الْعَدُوَّ فَلَمَّا هَزَمَهُمُ اللهُ اتَّبَعَهُمْ طَائِفَةٌ مِنَ الْمُسْلِمِينَ يَقْتُلُونَهُمْ وَأَحْدَقَتْ طَائِفَةٌ بِرَسُولِ اللهِ ﷺ وَاسْتَوْلَتْ طَائِفَةٌ عَلَى النَّهْبِ وَالْعَسْكَرِ فَلَمَّا رَجَعَ الَّذِينَ طَلَبُوا الْعَدُوَّ قَالُوا لَنَا النَّفَلُ؛ نَحْنُ طَلَبْنَا الْعَدُوَّ وَبِنَا نَفَاهُمُ اللهُ وَهَزَمَهُمْ وَقَالَ الَّذِينَ أَحْدَقُوا بِرَسُولِ اللهِ ﷺ مَا أَنْتُمْ بِأَحَقَّ بِهِ مِنَّا بَلْ هُوَ لَنَا؛ نَحْنُ أَحْدَقْنَا بِرَسُولِ اللهِ ﷺ أَنْ يَنَالَهُ مِنَ الْعَدُوِّ غِرَّةٌ وَقَالَ الَّذِينَ اسْتَوْلَوْا عَلَى الْعَسْكَرِ وَالنَّهْبِ مَا أَنْتُمْ بِأَحَقَّ بِهِ مِنَّا بَلْ هُوَ لَنَا؛ نَحْنُ اسْتَوْلَيْنَا عَلَيْهِ وَأَحْرَزْنَاهُ فَأَنْزَلَ اللهُ ﷻ عَلَى رَسُولِهِ عَلَيْهِ السَّلَامُ {يَسْأَلُونَكَ عَنِ الْأَنْفَالِ قُلِ الْأَنْفَالُ لِلَّهِ وَالرَّسُولِ} [الأنفال 1] الْآيَةَ فَقَسَمَهُ رَسُولُ اللهِ ﷺ بَيْنَهُمْ عَنْ فُوَاقٍ