Attitude Of Sahabas To Slavery
The verse is revealed before any encounter with the disbelivers. It is evident from the verse and supported by the fact mentioned in verse 20 where some weak Muslims or hypocrites were demanding that a command of jihad should be revealed: وَيَقُولُ الَّذِينَ آمَنُوا لَوْلَا نُزِّلَتْ سُورَةٌ ۖ فَإِذَا أُنزِلَتْ سُورَةٌ مُّحْكَمَةٌ وَذُكِرَ فِيهَا الْقِتَالُ ۙ رَأَيْتَ الَّذِينَ فِي قُلُوبِهِم مَّرَضٌ يَنظُرُونَ إِلَيْكَ نَظَرَ الْمَغْشِيِّ عَلَيْهِ مِنَ الْمَوْتِ ۖ فَأَوْلَىٰ لَهُمْ The historical record confirms that the prophet did not make slaves from the prisoners of war. See for details the article by Ghamidi saheb https://www.javedahmadghamidi.com/books/5aa6a4315e891e8f44a45788?chapterNo=9&subChapterNo=3&lang=ur