Exodus 21:4
If his master have given him a wife, and she have born him sons or daughters; the wife and her children shall be her master’s, and he shall go out by himself. If his master have given him a wife, and she have born him sons or daughters; the wife and her children shall be her master’s, and he shall go out by himself.
Exodus 21:4 belongs to the instruction God gave through Moses, together with the rest of Exodus 21-23, to guard against injustice and to regulate how people deal with one another. Unlike the Ten Commandments, it was delivered privately to Moses for him to communicate to the people. It was given as an additional precept because Israel, blinded and debased by slavery, was not prepared to fully appreciate the far-reaching principles of God's ten precepts.
It illustrates, applies, and amplifies the principles of the Ten Commandments, guarding their sacredness and explaining in detail what people owe one another so that the obligations of the Decalogue might be more fully understood and enforced. It belongs to the statutes regulating, protecting servants and governing their release, under which a Hebrew servant's service was limited to six years with freedom in the seventh, and he was not to be held as a slave for life or beyond seven years. Those servant laws required humane treatment, and an injury inflicted by a master could entitle a servant to freedom.
When freedom became his right, a servant could choose to remain with his master, but refusing liberty was treated as a mark of disgrace. These laws taught mercy, respect for servants' rights, and a love of liberty. Careful reading and obedience to these commandments would prevent the condition of things now seen in the world.