A government must exist to assure that no individual or firm takes advantage of others. Thus, property must be protected, contracts must be enforced, and in general all markets must perform the way they should. To this end, the government provides a court and judicial system.
The responsibility of the Food and Drug Administration (i.e. to verify that the ingredients of a product are shown on the label) is an example of how the government provides a legal environment. Another example is the verification of weights and measures.