Joshua Bowen, Did the Old Testament Endorse Slavery? (Mechanicsville, MD: Digital Hammurabi Press, 2020), 196-197.
Slavery was not endorsed arbitrarily, as it was part of a common economic system that existed in ancient Israel and in the wider ancient Near East long before the biblical period. Both debt-slavery and chattel-slavery were also part of the Mosaic Law, and the regulations on its practice in the text are generally on par with other legal systems in the region, both synchronically and diachronically. In other words, generally speaking, the laws seen in the Old Testament are part of a common legal system or tradition that can be seen in the ancient Near East.