First, it is important to know that thousands of years ago life was different than
today. Today, people wouldn't accept slavery for any reason. The reason for
this is because people are a lot more independent both financially, education wise,
mentally, etc... But people back then were different. When a tribe or a group
of people lose a major battle and their money is mostly, if not all, is taken as war booty
by the other side, then people could and would accept being slaves for the following
reasons:

1- Both financial and social security.
When their country or tribe lost the war, they also lost most or all of their money
as war booty. Being out of money and food, it becomes necessary for an individual to
find the means for basic survival in life. Living as a slave would provide this.

2- Protection from hostile individuals.
Even under the Islamic rule, you can still find hostile individuals who violate the
Law and take matters into their own hands. An enemy family can be sometime in danger
if they don't have a "protector".

3- Widows, Orphans, and the extremely poor
of the enemy side need the financial and social protection from a Master. Back then,
there were no governments with good social system that protects everyone. Slavery
back then was that social system in special cases.

There are probably more points I can add, but I think these are sufficient enough.

Islam and Slavery:

Islam is a religion that came to fight slavery and end it once and for all.
During Judaism and Christianity, slavery was at its highest peak in the Middle East.
People were enslaved and they and their children were inherited and passed down to
generations for ever. This tradition came from Leviticus
25:44-46 in the Bible's Old Testament, and further continued in the New Testament
in 1 Timothy 6:1, 1 Peter 2:18, and Colossians 3:22.

Now keep in mind that the entire Bible is corrupted and unreliable and is mostly filled
with man-made cultural laws and corruption!

GOD Almighty Said: "`How can you say, "We [the Jews]
are wise, for we have the law of the LORD," when actually the lying pen of the
scribes has handled it falsely?' (From the NIV
Bible, Jeremiah 8:8)"

The Revised Standard Version makes it even clearer: "How can
you say, 'We are wise, and the law of the LORD is with us'? But, behold, the false pen
of the scribes has made it into a lie.(From the
RSV Bible, Jeremiah 8:8)"

In either translation, we clearly see that the Jews had so much corrupted the Bible
with their man-made cultural laws, that they had turned the Bible into a lie!

See Also Deuteronomy 31:25-29 where Moses peace be upon
him predicted the corruption/tampering of the Law (Bible) after his death. The Book
of Moses predicted that the Law (Bible) will get corrupted. The Book of Jeremiah
which came approximately 826 years after did indeed confirm this corruption.

So Leviticus 25:44-46, 1 Timothy 6:1, 1 Peter 2:18, and
Colossians 3:22 above are highly doubtful to be Divine Revelations from GOD
Almighty, the Most Just, Most Merciful, and Most Wise. Please visit Just who were the real authors of the Bible?You
will see comments from the commentary of the NIV Bible (one of the most used Bibles world
wide) itself admitting that most of the Books and Gospels of the Bible are corrupted. No
one ever claimed ownership of the current Books and Gospels. The owners/writers are
unknown.

When Prophet Muhammad peace be upon him received the Divine Revelations of Islam,
slavery among the Pagan Arabs, Jews and Christians was quite common. When he came
with Allah Almighty's True Religion of Islam, he gradually eliminated slavery. He
couldn't enforce it all at once, because it would've caused Islam to be an unsuccessful
religion toward freeing slaves, and would certainly have broken Islam's system for ending
slavery.

By gradually freeing slaves and making it be acceptable to the society of many
different pagan cultures and traditions, the idea of eliminating slavery became powerful
enough that after Prophet Muhammad peace be upon him died, the freed slaves remained free
and non of them was ever enslaved again.

Prophet Muhammad peace be upon him said:

Narrated Abu Musa Al-Ash'ari: "The Prophet said,
"Give food to the hungry, pay a visit to the sick and release (set free)
the one in captivity (by paying his ransom)." (Translation of Sahih Bukhari, Food, Meals, Volume 7, Book 65, Number 286)"

Always remember!

It was not Islam that started slavery, but it was Islam that ultimately ended it.
Please visit The liberation of slaves
in Islamto see the Noble Verses from the Noble Quran and
the Sayings of Prophet Muhammad that command the Muslims to free all slaves.