About 1200 B.C. the Babylonian King Hammurabi inscribed a code of laws on a tall stele of black basalt. This wasn't the first document of its type but it is widely accepted as one of the most comprehensive, broad and intellectual of its type. Neither was The Code of Hammurabi the first example of law in this earliest of civilisations. Mesopotamia had already existed as a culture (if not a unified nation) for 1500 years and relied heavily on agriculture, trade and commerce. Clearly some sort of 'law' existed during this time but it was the invention of writing in about 2800 B.C. that enabled ideas of organisation and civilisation to be recorded.
How much detail the GM decides to go into largely depends on the type of game he is trying to run and what sort of society he has created. Law's reflect a societies 'norms' and define what is right and what is wrong based on those norms. The laws of an evil culture like those of Dark Elves would be different from a benign culture. Similarly the priorities - and therefore the rules - of a tribal society would necessarily be different from those of a structured and civilised state.
Some Laws however are universal and essential to the smooth running of any society, regardless of its socio-political belief system.
- Do not kill people
- Do not steal another's property
- Do not damage or destroy another's property
- Do not covet a neighbours property/wife
- Do not challenge the rule of authority
- Do not lie or bare false witness
These probably sound familiar as all of them are included in the ten commandments and other faith based laws. Without these basic rules society cannot hold itself together and function effectively. Moreover they form the building blocks for all the subsequent refinements and subcategories of law that we know today.
Punishment for breaking laws will again vary with the culture involved and the degree of importance that each law holds within that society. In most medieval and ancient societies punishment generally took the form of some kind of retributive action that reflected the crime committed. Therefore murder incurred a death penalty and stealing resulted in physical justice (decapitation of a hand for example). Unfortunately history also teaches us that in less developed societies social status & personal wealth greatly influence the punishment decreed.
There is plenty of material on the Internet that the GM can use to create a basic set of laws for their campaign world. Whatever you decide to use it will enhance the realism of your campaign setting and may even create some exciting roleplaying encounters along the way.