Before beginning, we must remember that slavery isn't something established by Islam, but it was there since before the advent of Islam and was a normal, common and accepted matter in all parts of the world. Islam has tried its best to prevent and eradicate it in different ways, being careful not to harm the owners of slaves as much as possible at the same time and not do anything sudden and irrational that will break the order and harmony of society. The way Islam proposed for the freedom of slaves eventually resulted in slavery being uprooted in Islam. Nevertheless, there are two points that need to paid attention to:
1- Sometimes this question comes to mind that why was it that the children of slaves had to also be slaves just because their fathers were? The answer is that despite all of the hardships slavery would bring for them, it was still to their benefit to remain slaves because of a type of social welfare that Islam provided for them. Regarding this subject, you can refer to question 3084 (website: 3337).
2- The second question is: “Is slavery possible in Muslim societies today, regardless of whether the slaves are male, female, young or old?” The answer to this question is that slavery isn't permissible in today’s Muslim societies, because even if there is a war between a Muslim and non-Muslim nation and some non-Muslims are taken prisoner and all of the Islamic conditions for keeping slaves are met, there are still other things that won't allow such a thing; like the treaties and international conventions and pacts that signatory countries must adhere to and have legislated therein. At the same time, according to Quranic verses, it is mandatory to fulfill vows and contracts on behalf of the Muslim society [so when a Muslim country agrees not to allow slavery anymore, it shouldn’t]. Neither Muslim countries nor their citizens are allowed to take anyone as slaves and break international laws that they have vowed to adhere by.