The firsts codes of law came from the ancient cities, you know like rome and greece, and jerusalm. They had laws like we do now, for example, if you steal thats against the law, what is the punishment? its stated in the law you will go to jail or do community service. Modern days it pretty much the same thing, we took those building blocks that the early humans have made and just built on top of it making it better. (if you need more info just comment)