For much of the Torah (the first 5 books of the Old Testament), the reader is faced with list after list of rules that the Israelites were meant to follow. Exodus 22 is where they begin. Many people, and perhaps most people, point to sections like this as proof that the religion of the Old Testament is one based on works, that in order to gain a right standing before God, one must obey every little rule that He laid out for His people. They call God mean and demanding.
In reality though, in giving the Israelites the Law, He was being incredibly gracious. Before this time, no god had ever given a list of dos and don’ts for their worshipers to follow. People were flying blind in a sense, making sacrifices and keeping arbitrary laws to try and appease their false god. This led to things like cult prostitution and human sacrifice. But the God of Abraham, Isaac, and Jacob set down a law that was meant to protect the people, especially the poor, children, sojourners, and women, as well as to communicate something very specific about His own character, namely that He is serious about the way in which we come to Him.
God knew from the start that there was no way that the Israelites could keep His law. He made the law to show them what He considered sinful and what He considered commendable, so that they would not have to guess and fall into pagan worship practices. Of course, The New Testament sheds more light on this issue. Paul says in Romans that the Law was laid down to reveal the sins of the people, but that Christ came obeying the law and dying as one who did not, so that we might receive the blessings due to Him because of His perfect obedience.
“Christ redeemed us from the curse of the law by becoming a curse for us” (Galatians 3:13). Praise His name!