Islamic law gives slaves certain rights:

It's misleading to use phrases such as 'Islamic slavery' and 'Muslim slave trade', even though slavery existed in many Muslim cultures at various times, since the Atlantic slave trade is not called the Christian slave trade, even though most of those responsible for it were Christians.

Islamic views on slavery - Wikipedia

Unlike the Western slave trade, slavery in Islam was not wholly motivated by economics.

BBC - Religions - Islam: Slavery in Islam

Although Islam is much credited for moderating the age-old institution of slavery, which was also accepted and endorsed by the other monotheistic religions, Christianity and Judaism, and was a well-established custom of the pre-Islamic world, it has never preached the abolition of slavery as a doctrine.

ISIS, Slavery, and Islamic Abolitionism | HuffPost

The condition of slaves, like that of women, may well have improved with the coming of Islam, but the institution was not abolished, any more than it was under Christianity at this period.

While slavery was in theory greatly limited by Islamic law, in practice it persisted on a large scale in Muslim lands.

Unlike the Atlantic slave traders, Muslims enslaved people from many cultures as well as Africa. Other sources included the Balkans, Central Asia and Mediterranean Europe.

During the 20th century attitudes to slavery changed radically and in 1990 The Cairo Declaration on Human Rights in Islam stated that:

Slaves in the Islamic world were not always at the bottom of the social hierarchy. Slaves in Muslim societies had a greater range of work, and took on a wider range of responsibilities, than those enslaved in the Atlantic trade.

Some other Muslim countries passed laws allowing for the prosecution not only of the sellers of slaves but the buyers too.

During her visit to Egypt, Murad met with President Abdel Fattah el-Sisi. She tweeted that she was "asking the Islamic world to stand firmly and clearly against ISIS."

UQconnect, The University of Queensland

A poignant paradox of Islamic slavery is that the humanity of the various rules and customs that led to the freeing of slaves created a demand for new slaves that could only be supplied by war, forcing people into slavery or trading slaves.

The answer is that slavery is legal under Islamic law but only in theory. Slavery is illegal under the state law of all Muslim countries.

It's ironic that when the Atlantic slave trade was abolished the Eastern trade expanded, suggesting that for some Africans the abolition of the Atlantic trade didn't lead to freedom, but merely changed their slave destination.

Islamic law allows slaves to get their freedom under certain circumstances. It divides slaves with the right to freedom into various classes:

The legality of slavery in Islam, together with the example of the Prophet , who himself bought, sold, captured, and owned slaves, may explain why slavery persisted until the 19th century in many places (and later still in some countries). The impetus for the abolition of slavery came largely from colonial powers, although some Muslim thinkers argued strongly for abolition.