Islam has a concept which is often translated to english as "slaves" and other times as "servant" because it really has a meaning inbetween those 2 words.
This servant does not have his own freedom, and is in that way comparable to a slave to some degree. But at the same time he is made a part of the family. The prophet Muhammad commanded muslims to treat them well. To feed them and clothe them the same way that you feed and clothe yourself. And to not hit them. And to not put them to hard work unless you help yourself. So there is a very big difference from how we in the West understand the word slave. I will quote some sayings from the prophet regarding this below. Many slaves held very important jobs with a lot of power and responsibility (so not just manual work).
Islam generally forbids all sexual relations between people except between a man and his wife. However, since a female "servant/slave" also lives in the same house as the owner and is under his guardianship there is a verse in the Quran which seems to allow sexual relations between the female slave and the male owner. The exact interpretation differ. Some say it is if they get married and others that it is allowed even without marriage. But it is an allowance for them to have voluntary sex with each other. it is not a permission for rape (since this would be like beating and worse which is not allowed). From what I know there is agreement that if she gets pregnant she is a free woman and is treated that way, and the child is recognised by the father (in fact many caliphs during islamic history were sons of such a slave woman but were made heir to the throne by their father).
Islam also puts huge emphasis on it being a good deed to give slaves their freedom and it is very, very recommended. Many muslims believe that the islamic rules would naturally lead to slavery disappearing over time, but that it was impossible to simply abolish it from one day to another since this could cause the society to collapse since it was dependent on the institution (anyone who wants to see how impossible it is to abolish slavery from one day to another can watch Game of Thrones where Daenarys tries to do this and it goes wrong). Many muslims also sees it as rules which were used in specific times - for instance after a war - where you would have many children and female widows with no man to protect them from other men. These women and children would then get a guardian who had to feed and clothe them, but who instead had the right to tell them to help with work etc. It is the opinion of many scholars if not all scholars that slavery is no longer allowed since all the people that used to be slaves have been set free and it is not allowed to make new people into slaves.
ISIS have reached opposite conclusions than all islamic scholars. They ignore the prophets command to treat the slaves well and instead allow rape. In their sick mind the permission to have sex with them is the same as permission to rape. Apparently they do not know the difference.
Here are some of the quoted from the prophet:
"The Prophet, peace and blessings be upon him, enjoined good treatment of slaves and he would say, “Feed them from the same food you eat and clothe them from the same clothes you wear, and do not torture the creation of Allah the Exalted.”
Source: Al-Adab Al-Mufrad 188
Narrated Al-Ma'rur: At Ar-Rabadha I met Abu Dhar who was wearing a cloak, and his slave, too, was wearing a similar one. I asked about the reason for it. He replied, "I abused a person by calling his mother with bad names." The Prophet said to me, 'O Abu Dhar! Did you abuse him by calling his mother with bad names You still have some characteristics of ignorance. Your slaves are your brothers and Allah has put them under your command. So whoever has a brother under his command should feed him of what he eats and dress him of what he wears. Do not ask them (slaves) to do things beyond their capacity (power) and if you do so, then help them.' " — Sahih al-Bukhari, 1:2:30