Law is a system of rules created and enforced through social or governmental institutions to regulate behavior. It can be state-enforced, resulting in statutes, or privately established through the courts (common law jurisdictions) or by other means such as contracts. Law shapes politics, economics and history, and it serves as a mediator of relations between people.
Legal systems vary from country to country, and even within a single country, but they tend to fall into groups or patterns with similarities based on historically accepted justice ideals. They can include elements of common law, civil law, religious law, and customary law. Some countries also use more than one legal system at a time, often in combination.
A fundamental goal of law is to ensure that all people have a clear set of rights, and that they are treated equally by the police, governments and public officials. When people disagree, such as when two people claim ownership of a piece of land, they turn to the law to resolve the conflict peacefully.
Some areas of law, such as tort laws, protect individuals when they are harmed or defamed. Others, such as criminal laws, punish the offender. Still others, such as property law or immigration law, establish the rules that apply to specific groups of individuals. The development of law is complicated by the fact that it involves a mixture of social and political values, which are often difficult to evaluate objectively.