This short teaching covers exactly what slavery meant in the ancient Near East and why a person would be willing to sell themselves for their own benefit. Needless to say, slavery in the ancient Near East was very different from what we think of as slavery today.
At the end of every seven years you shall grant a release. And this is the manner of the release: every creditor shall release what he has lent to his neighbor. He shall not exact it of his neighbor, his brother, because the Lord's release has been proclaimed.