How Laws Evolved by Natural Selection (Peter DeScioli Ph.D., August 8, 2023, 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.
Quite. Evolution is just a tool for intelligent use.