Speaking more plainly...
Speaking more plainly, if Islam, by means of one general order, had ordered the people to free all the slaves in one stroke, most of the slaves might have possibly perished since, at times, they constituted nearly half of the population of the society. Coupled with this was the fact that they had no source of income, no independent work, no dwelling, and no means to lead their lives.
If all the slaves were to have become free on one day and at one particular hour, a huge unemployed group would have suddenly manifested itself within the society, such that not only would it have placed itself in difficulty and endangered its own existence, but would have also thrown the entire discipline and order of the society into disarray.
This is because when they experienced the pressures of deprivation, they would have had to resort to violence and aggression, and this would have led to dissension, skirmishes, and bloodshed. Therefore, it was vital that they became free and got absorbed into the society, gradually, so that neither did their own lives fall into peril nor did they threaten the peace and security of the society, and it was this calculated strategy that Islam pursued.
There are several parts to this strategy, and the most important points from each of them shall be listed here, although briefly, since a detailed explanation demands that a separate and independent book be written for the purpose. The First Part: Eliminating the Sources of Slavery Throughout the ages, there have been numerous factors and causes of slavery. Debtors who were unable to pay off their debts and prisoners of war ended up as slaves.
Power and strength provided a license for procuring slaves. Powerful nations would send their forces armed with various weapons to the backward nations of the African continent and other such regions, subjugating their inhabitants into captivity, and transferring them in groups, by means of ships, to the markets of Asian and European countries. Islam put its foot down upon these means and approved only one instance of slavery – prisoners of war.
In addition, even this was not obligatory; it granted permission that, in accordance with the general welfare and expediencies, they could be set free, either unconditionally or after payment of ransom.