Slavery was a part of human existence throughout the life of our species, usually the result of warfare, until 200 years ago. Then in about a century it became disreputable everywhere.
Until about 500 years ago, white Europeans kept each other as slaves. The Roman Empire was a major slave society, as were the glorious classical Greeks. Nowhere in the Hebrew Bible or the New Testament was slavery condemned as a moral evil. In the societies that produced the Bible, and everywhere else, people recognized that it was a great misfortune to be enslaved, but no one thought that it was evil to have slaves.
Furthermore, while slavery was disappearing among Europeans Muslims were kidnapping European travelers on the Mediterranean, and selling them for ransom, or into slavery. There was also a well-known slave trade along the shores of the Black Sea as locals captured their neighbors to sell to Islamic traders.
Of course the same arrangements existed in west Africa, as some locals would capture other locals to sell to the Europeans. Many Europeans of the day thought that kidnapping people into slavery went against God’s laws, but buying and selling people who were already slaves was, apparently OK with the Big Guy.