Law is the ability for a race to create a system of rules which it uses to control or influence patterns of social behaviour.
It was originally gifted to the beholder race, who, being a xenophobic and distrustful lot, used it to create border controls between their own territory. They were eager to teach it to humans when they came close, with the hope that they would learn the laws, and then respect them and stay away from their borders.
Combined with economics, law provides taxes, which have become incredibly popular with powerful people. Combined with faith, law provides a system of justice, allowing judgments to be made concerning situations involving moral and ethical dilemmas.