Janab Sidqi Bhai,
The exalted prophet eliminated slavery as ordered in the Qur'an. A few decades after him, kingship took hold of the Islamic empire and many customs of JAHILIYYAH came back.
kindness or ransom
47:4 If you meet the disbelievers in battle, strike at their command centers until you have subdued them, then, bind them firmly. And thereafter, there must be an act of kindness or ransom when the battle lays down its weapons. If God willed, He could punish them Himself, but that He may let you be tested by means of one another (as to who remains steadfast.) As for those who are slain in the way of God, He does not render their actions vain. [Free the captives as an act of kindness or ransom, such as in exchange for your men in their captivity. There is no third option. Fadharb ar-riqaab is usually rendered as ‘smite their necks.’ A little contemplation, however, makes it plain that in a battle of swords and arrows no commander would order his soldiers to aim for the necks alone. Therefore, the term has been used idiomatically, indicating knocking out the command centers. It is interesting to note that even in today’s encounters with high technology this principle is given a top priority. This verse halted slavery since the source of slaves and concubines used to be battles and raids. 8:67, 90:13]
Battle was the only source of enslaving people and the above verse plus many others halted the scourge of slavery.
What we see today in the Middle East is N2I in violation of the Glorious Qur'an.