I never realized that the law was actually an incredibly gracious act on God’s part until I studied the religious climate of Ancient Near East.  Here is a quote from a prayer that was found on a tablet dated to the mid-seventh century B.C.  It is called “a prayer to every god”

May the wrath of the heart of my god be pacified!
May the god who is unknown to me be pacified!
May the goddess who is unknown to me be pacified!
May the known and unknown god be pacified!
May the known and unknown goddess be pacified!
The sin which I have committed I know not.
The misdeed which I have committed I know not.

This dude had no idea what to pray so he prayed to every god, he knew he had made something or someone upset, but didn’t know what he had done or why it was angry.  Whoever wrote this prayer had no relationship or knowledge of his god, had no clue how to enjoy his god, had no clue what angered his god, or even who his god was.  He just knew that he had done something wrong. 

It is in this religious context that Yahweh, the God of Israel says, “if you will indeed obey my voice and keep my covenant, you shall be my treasured possession among the peoples, for all the earth is mine; and you shall be to me a kingdom of priests and a holy nation” (Exodus 19:5-6). 

 It is the fact that Yahweh graciously revealed Himself and his holiness to Israel through the law that makes Israel say among the nations, “what great nation is there that has a god so near to it as the LORD our God is to us, whenever we call upon him? And what great nation is there, that has statutes and rules so righteous as all this law that I set before you today?” (Deuteronomy 4:7-8).  The relationship between Israel and God was something unheard of in the Ancient Near East, and it remains the distinguishing mark of God today–He loves his people, he lived with his people, and he suffered for his people.