Peter DeScioli in Psychology Today:
Laws may seem unlikely to come from evolution. There are so many laws, and they differ so much across societies. This variation shows that natural selection did not install a single code of laws in the human mind. We do not have 10 commandments, or five or 20, etched into our minds, or else we would see the same code of laws repeated in society after society.
But does this mean that human evolution has little to tell us about the origin of laws? Not at all. To see why, just compare laws to tools. Humans make countless tools, and tools vary tremendously across societies. Yet, it is well-understood that humans evolved adaptations to make and use tools. The human mind does not have a fixed set of blueprints for 10 or 20 tools.
More here.