The 10 plagues show God's supremacy over the gods of Egypt. Once the Israelites left Egypt they still struggled with slavery to the gods. The 10 commandments are not so much law as they are a manifestation of God's grace meant to show the Israelites how to live free.