Once upon a time, God established a grand light (imagine the Sun) to enlighten our paths on the Earth. The light revealed what was true and exposed what was evil. It shall be called Morality. Men began to hide from this light, living in shadows and doing what they knew was contrary and perverse.
God chose a people to lead, and bestowed on them a secondary guiding light (imagine the Moon), by which they could exercise judgment and order. This is what the Israelites received as the Law. It was borne from Morality. Where Morality was not easily discerned, the Law was a clear standard for justice.
In other lands, men also, perceiving the need for such a legal framework, created lights of their own to help them exercise justice. For certainly, all could not live up to the glorious light, which set a standard too high for any to be justified!