The institution of slavery was a major part of pre-Islamic Arabian civilization. The Islamic position on slavery represents a complex and multidimensional body of Islamic thought, and a significant shift in the conventional thought regarding slavery at that time.
Prior to Islam, there were a variety of ways a person could be enslaved including debt slavery, as punishment for a crime or other wrong against a person or family, captives of war, abduction or kidnapping, or being sold by family members. The Quran and the hadith (sayings of the Prophet Muhammad) address slavery extensively, assuming its existence as part of society but viewing it as an exceptional condition and restricting its scope.
Islam limited the sources of slavery to one circumstance, captives of war. This exception was recognized because, ostensibly, all of the other reasons could be controlled within the Muslim jurisdictions, except for how other, non-Muslim, warring parties would handle prisoners of war. The common practice throughout civilization at that time was to either kill captives of war, ransom them, or make them slaves. Islam forbad the killing of those captured and, thus, only allowed slavery within these parameters.
Moreover, early Islamic law forbade enslavement of free members of Muslim communities, including non-Muslims, and set out to improve the conditions of human bondage. Islamic jurisprudence instituted directives that required just treatment of slaves by their owners and society.
Your slaves are your brothers. God has placed them under your authority. He who has his brother under him, should feed then from whatever he eats, and dress him them with whatever he wears, and do not burden them …
Accordingly, bound persons were absorbed into the principles of Islamic brother/sisterhood. The freeing of slaves also became mandatory in certain cases. Any level of violence against the slave would mandate his freedom. The Prophet said:
He who slaps his slave or beats him, the expiation for it is that he should set him free.
Islam also encouraged people to free slaves by rewarding them. As stated in 90:11-13, one way to overcome a difficult pass is to free a slave. Likewise, the prophet said:
He who emancipates a slave, God will set free from Hell every limb (of his body) for every limb of his (slave's) body.
Additionally, it became common to grant freedom of a slave as a form of expiation for unacceptable acts within the religion (ie. breaking a promise, killing by obvious mistake, not fasting during Ramadan, etc).
Islam recognized slavery as an ignominy and intended to limit its resources to lead to a natural abolishment of the practice.
Many early converts to Islam were former slaves. Some notable examples are Bilal ibn Rabah al-Habashi, a chief companion of the Prophet Muhammad; Safiyya bint Huyayy, whom the Prophet Muhammad freed and married; and Zayd ibn Harithah, whom the Prophet Muhammad freed and adopted as a son.
 While the mainstream view is that the Quran accepts the institution of slavery, in very limited circumstances, there are scholars who interpret key verses to prohibit all post Islam bondage. For instance, scholars note that the word 'abd' (slave) is rarely used in the Quran, being more commonly replaced by some periphrasis such as ‘ma malakat aymanukum’ ("that which your right hands own"). Some scholars have highlighted the point of view that the term is used in the past-tense in the Quran, thus signaling only those individuals who were already enslaved at the dawn of Islam. This slight change in tense is significant, as it allows scholars to argue that slavery was never compatible with the commandments of the Quran and is in fact outlawed by Quranic Law.
 Muslims were able to enforce rules prohibiting people to take slaves to repay debts, as well as, all of the other above reasons within their borders.