Slavery was a legitimate thing in Biblical times.
There were laws for protection of all types of slaves and that included slaves that were bought from other nations. But that part of the law imo was there because God knew that this would happen,,,,,,,,,,, just like divorce was allowed because God knew it would happen anyway.
The law and the prophets was one thing but with Jesus we see God's truth coming where all are equal in Christ and the slave trade is classed as an evil practice even if the institution of slavery is not something specifically spoken against,,,,,,,,,,,,,, just as the other 100 common social practices of the day were not specifically spoken against. That would come in it's day, when people were ready to hear the truth just as other accepted practices also disappeared over time due to the teachings of Christianity.