Law is the system of rules that regulates people and society, and is enforced through institutions with authority to do so. It can be created by legislative bodies through statutes and regulations, or by judges through case law (in common law jurisdictions). Law can also be based on religious precepts (e.g. the Jewish Halakha and Islamic Sharia) or canon law (in church communities). Law may be an area of specialized knowledge in the form of legal maxims, or it can cover the whole of human activity through legal systems such as civil, criminal, international, and constitutional laws.
The field of law encompasses many sub-disciplines: contract law, employment law, criminal law, and property law, for example, deal with agreements and relationships between individuals and corporations. Law can also be a source of scholarly inquiry, covering such areas as legal history, philosophy, economic analysis and sociology.
The purpose of the legal system is to ensure that everyone abides by a set of standards, so that disputes can be settled without conflict. However, even in well-ordered societies, some disagreements are inevitable. Law enables them to be resolved peacefully, so that nobody is hurt or financially penalized in the process. This is achieved by ensuring that people have the same rights and duties, and by protecting private property. Laws also protect citizens by preventing discrimination, enforcing consumer protection, and regulating the use of force in public affairs. In addition, law provides a framework for the conduct of politicians and the behavior of government officials.