When God gave the Ten Commandments, "He added no more" (Deuteronomy 5:22). It was a complete spiritual law. Still, God knew that for a physical nation, there would have to be a civil administration with much more detail about what constituted crime and what judgments to execute against specific violations. He had already given capital punishment in Noah's day. It is not known if He had related any other judgments at that time, although it seems likely that He would have. Frankly, judgments were needed because God knew people would not remain chaste and law abiding (see Exodus 22:16). He knew that they would take advantage of others wrongly (22:25) -- and He provided for these eventualities. The judgments exist because of human failings. Penalties would not be needed if people always obeyed. But they don't - and this could wreak havoc in a national setting. So besides the tablets of the Ten Commandments, God here gives Moses the judgments. These judgments were based on God's law of love and pertained to relationships between the people.
God allowed slavery, but in a much different way than one may perceive today. An Israelite may have become a slave due to poverty, debt, or crime. After six years of servitude, God commanded that he be given freedom and help to reestablish himself so as to better avoid getting in the same situation again (Deuteronomy 15:12-15). Israelite slavery was similar to a state of indentured servitude. The purpose was not intended to be heavily punitive. The intention was to enable a person to make a new start and help him succeed in life. God also gave laws regulating the treatment of slaves. In fact, it was expected that some would be treated so well that they would want to stay with their masters even after the time came for them to be set free (verses 16-18).
It was a capital crime to curse or hit one's parents. This judgment was based on the Fifth Commandment, "Honor your father and mother." While the punishment may seem cruel and unusual to our 21st-century minds, its intent was that Israel not raise a nation of rebellious children, as we see so frequently today in our supposedly enlightened societies. This law, like many others, acted as a safeguard for society as a whole. If a rebellious child showed so little respect for authority that he would lash out and strike his own mother or father, there would be little to prevent him from striking out and injuring or killing others. Thus this law helped remove those who scorned authority and lacked the will or desire for self-control before they became too great a threat to innocent people around them. When this law was enforced, society as a whole was kept safe from young, out-of-control thugs who had chosen to live in a way that made them a danger to everyone else.
The words "eye for eye, tooth for tooth" were not intended to encourage vengeful feelings. Nor were they to be taken literally (although "life for life" and "stripe for stripe" could be literal). The principle was that the punishment should fit the crime and not go beyond it. On occasion, capital punishment had to be imposed. But in other cases, we read that there were various ways the guilty party could be redeemed.
God's laws are not given as a burden to His people. On the contrary, they are imposed to prevent problems from occurring. All people shared a responsibility in both preventing and solving problems. We will be reading much more about God's laws, comprising commandments, statutes, judgments and ordinances. God revealed them to define what He means by love. Love is the fulfilling of the law (Romans 13:10).