One of the laws presented in Exodus 21 is that you cannot steal someone and sell them as a slave. That’s what was happening in the African slave trade. Africans were kidnapping and selling each other. They would raid villages and round up anyone who could fetch a price and sell them.
How did people become slaves among the Hebrews? They haven’t been to war to have captured them. These are slaves of poverty. They may have sold themselves into slavery. “We’ll be your slaves, just provide for us.” Someone could give themselves or their child over to slavery because they can’t pay a debt. They offer their service as a way to pay the debt.
God lays down the law on how they are to be treated. If a master hurts a slave in some irreversible way, the slave gets to go free. A master who kills his slave can lose his life. God puts laws in place so that the slaves are protected.
There was only a freedom date set for the men, as in they could go free after seven years. The law was different for the women, but they were provided freedom or protection. The law was they had to be provided for, and if they weren’t, they were free to go. God was protecting them.
God’s eye is on the sparrow, even on the least of these. He wasn’t neglecting a soul.