Slavery, when invented as a real-world institution, was seen as beneficial to both parties as compared to the alternatives.
Such as:
Kill the losers off completely.
Risk the losers regaining strength and coming after you again, and killing you off completely.
Since we know 'never fight amongst ourselves' isn't an option, when the war's over, you gotta do something with the losers. Slavery allowed the losers to continue to live, and to be a contributive part of humanity, while the winners got to be the ones to take credit for the advancement of civilization. Think of all those wonders that simply couldn't have come into existance without slavery. We'd not even be in the Industrial Age, able to free slaves, without having had them in the first place.
But the big problem is that slavery corrupts both slave and master, and nowadays, when you hear the word, you think only of "Uncle Tom's Cabin" (even if you've never read it). The USA was not the first country to have slaves, and Africans were as much perpetrators as they were victims; who do you think went out and got all those slaves and sold them?
Even now, slavery is alive and well, but it's been hidden better and called other names. Probably every single one of us on this forum is a slave to someone; a boss, a government that serves only a few special interests or businesses, the latest marketing fads... There's a lot less whipping and chaining involved than before, but that just means the cage is nicer, not absent.