Under the Law of Moses, God instructed Israel how to administer justice when kidnappings occurred.
GOD gave the following instructions in the Law about kidnapping:
17 Whoever kidnaps one of the children of Israel and overcomes and sells him, and he is found with him, let him surely die.Exodus 21:17 OSB
7 “If a man should kidnap any of his brethren of the sons of Israel and mistreats him or sells him, then that kidnapper shall die; and you shall put away the evil from among you.Deuteronomy 24:7 OSB
The protection against selling the kidnapped victim into slavery reminds us of Joseph, the forefather of the tribes of Ephraim and Manasseh. GOD wanted to prevent any additional instances of such evil among Israel.