Law is a set of rules created and enforced by social or governmental institutions to regulate behavior. It shapes politics, economics, history and society in various ways, and it serves as a mediator of relationships between people. In most modern nations, the rule of law is one of the primary functions of government. The law provides a foundation for democracy, protects the environment, preserves property and ensures fairness in justice.

The precise nature of the law is a subject of longstanding debate. Some scholars define the law as a set of commandments ordained by a higher power, while others describe it as a system of human values and principles for conducting societal affairs. The law, whatever it is, must be permanent as to time and uniform as to persons in order for it to be binding. It also must be enforceable, meaning that it can be enforced by a competent authority.

The laws that are established and enforced in different countries vary greatly, as do the legal systems within those countries. Some governments use a civil law system, in which statutes are the basis for many legal matters, while others, such as the United States, have a common law system that relies on judge-made precedent. In addition, religious laws sometimes play a role in settling legal disputes.

A governmental body that makes and enforces the laws of a country is called a legislature, and a legislative body that is composed of two houses, with each house having equal voting rights, is known as a bicameral legislature. A legislative measure that has passed both houses of Congress is a bill, and once it has been approved by the President, it becomes a law.

Another important function of the law is to prevent corruption and other wrongdoing in a society by making it illegal to commit certain crimes or to benefit from other crimes. To do so, a legislative body creates and enforces laws through an elaborate process that includes checks and balances to prevent abuse of power.

In the United States, the lawmaking process involves a three-tiered structure that begins with a state’s governor and continues with its executive branch and the federal government. A person who violates a federal law is considered guilty of a felony and can be prosecuted by the federal courts or by state prosecutors.

Other important parts of the legal system include the judicial branch, which includes the courtroom, the jury selection process and the clerk of court. In courtrooms, a judge preside over a case and decides whether the defendant is guilty of a crime. During the trial, evidence is presented through testimony and documents. The court reporter makes a word-for-word record of the proceedings and produces a transcript upon request. A plaintiff or defendant may choose to appeal a judgment by asking an appellate court to review the ruling. An arraignment is the initial hearing at which a defendant is brought before a judge and told of the charges against him or her.