A possible question: Islam regards slavery as a social evil, regardless of how well slaves are treated or how many rights they enjoy. Therefore, why was it not abolished, as happened with alcohol, interest, gambling, or prostitution? Why did the Prophet condone it?
Until the evil of the European slave trade, slavery was largely a byproduct of war, for the victors normally enslaved the survivors. During Islam's early years, there was no reliable system of exchanging prisoners of war. The available means of dealing with them were execution, placing them in prison, allowing them to go home, or distributing them among the Muslims as spoils of war.
The first option must be ruled out on the grounds of its barbarity. The second is practicable only for small numbers and for a limited period of time, provided that there are enough resources to care for them. This option was used, for prisoners were taken in the hope of ransom payments. Many Makkans held by the Muslims were so satisfied with their treatment that they became Muslims and changed sides. The third option is imprudent in times of war. This leaves, as a general practice, only the fourth option. Islam instituted humane laws and norms for what is, in effect, the rehabilitation of prisoners of war.
While living among Muslims, slaves saw at close quarters the truth of Islam in practice. Many slaves were won over by the kind treatment they received and Islam's humanity, not to mention their access to many of the legal rights enjoyed by Muslims, and, ultimately, by the chance to regain their freedom. Thousands of ex-slaves can be found among the great and famous names in Islam, and their won examples became a norm for future Muslims—imams such as Nafi' (Imam Malik's teacher) and Tawus ibn Qaisan, to name only two.
In general, Muslims considered slavery a temporary condition.
Unlike Western civilization, whose values are now so much in fashion, slavery was not an inherited condition that engulfed whole generations in deepening spirals of degradation, despair, and hopelessness. On the contrary, enjoying a status as fundamentally equal to everyone else, slaves in Muslim society could and did live in secure possession of their dignity as creatures of the same Creator. They had access to the mainstream of Islamic culture and civilization—to which, as we have noted, they contributed greatly. In Western societies where slavery was widespread, particularly in North and South America, the descendants of slaves, even generations after their ancestors' formal emancipation, remain largely on the fringes of society, a sub-culture or anti-culture—which is only sometimes tolerated, and mostly despised, by the dominant community.
When the Muslims were secure against foreign conquest, why did they not free all of their former captives or slaves?
Again, the answer has to do with existing realities. Those former captives or slaves did not have the personal, psychological, or economic resources needed to establish a secure and dignified independence. Remember what happened in the United States when the slaves were suddenly freed by President Lincoln. Many were abruptly reduced to destitution and homelessness by their former owners (who were compensated) who no longer accepted any responsibility for them. They were thrown, without any preparation, into the wider society from which they had been so long excluded by law.
In contrast, observant Muslim masters who embraced their slaves as brothers and sisters encouraged them to work for their freedom, recognized their rights, helped them support a family, and helped them find a place in society before freeing them. The example that comes to mind is that of Zayd ibn Harith, who was brought up in the Prophet's own household and set free. He married a noblewoman and was appointed commander of a Muslim army composed of many noblemen and Companions. There are many similar examples.
There are two important points to emphasize here: the Muslims' attitude toward slavery, and the condition of slaves in non-Muslim countries. Islam considers slavery an accidental and therefore temporary condition, one that is to be reformed step by step until it almost completely disappears. However, it has been observed that some Muslims, especially rulers, continued to hold slaves. Islam cannot be blamed for this, for it is the individual Muslim's own spiritual deficiency that caused him or her to behave in such a manner.
The other point is that personal habits engender a second nature. When Lincoln abolished slavery, most slaves had to return to their former owners because they had never learned how to take the initiative and choose for themselves. As a result, they could not live as free people. Given this psychological reality, prisoners of war were distributed among Muslims so that one day they could live a true Islamic social life as free people in a Muslim society and enjoy their full legal rights.
Islam sought to abolish slavery gradually.
In the first step, it enabled slaves to realize their true human consciousness and identity. After that, it educated them in Islamic and human values, and inculcated in them a love of freedom. Thus, when they were freed, former slaves were equipped to consider all kinds of possibilities related to becoming useful members of the community: farmers, artisans, teachers, scholars, commanders, governors, ministers, or even prime ministers.
Islam attempted to destroy the institution of "individual slavery," and never envisaged or tried "national slavery." So, as a Muslim, I pray to God that enslaved—colonized, oppressed—peoples will enjoy real freedom.