Societies define crime as the breach of one or more rules or laws for which some governing authority via police power may ultimately prescribe a conviction. While every crime is a violation of the law, not every violation of the law is a crime, for example, breaches of contract and other civil law are offences or infraction.
When society deems informal relationships and sanctions, insufficient to establish and maintain a desired social order, there may result compulsory systems of social control imposed by a government, or by a sovereign state. With institutional and legal machinery at their disposal, agents of the State can compel populations to conform to codes, and can opt to punish or reform those who do not conform.
Authorities employ various mechanisms to regulate prohibited conduct, including rules codified into laws, policing people to ensure they comply with those laws, and other policies and practices designed to prevent crime. In addition, authorities provide remedies and sanctions, and collectively these constitute a criminal justice system. While incarceration may be of temporary character and therefore aimed at reforming the convict, in some jurisdictions penal codes are written to inflict a permanent harsh punishment either in the form of capital punishment or life without parole.
The label of "crime" and the accompanying social stigma normally confine their scope to those activities seen as injurious to the general population or to the State, including some that cause serious loss or damage to individuals. The labellers intend to assert the hegemony of a dominant population, or to reflect a consensus of condemnation for the identified behavior and to justify a punishment inflicted by the State (in the event that standard processing tries and convicts an accused person of a crime). Usually, the perpetrator of the crime is a natural person, but crimes may also be committed by legal persons.