Law is the body of rules that a nation-state adopts and enforces to govern its citizens. It has the fundamental purpose of keeping peace and maintaining order within a society, but the specific role it plays varies widely from nation to nation; for example, laws might seek to promote individual liberty by allowing people to make contracts freely or to provide for their own care and support, or they might aim to ensure that everyone receives equal treatment before the courts. The legal system is also a means of preserving social heritage, promoting social change and ensuring that economic growth is fair.

A country’s laws are the result of its culture, history and traditions, but they may be based on religious precepts as well. Several religions have laws that are explicitly written down in scriptures such as the Jewish Halakha and Islamic Sharia, or in the Christian canon. These laws are the starting point for further elaboration through interpretation, Qiyas (reasoning by analogy) and Ijma (consensus).

Most countries today have civil law systems that are based on legislative statutes, and judicial decisions. These systems are often characterized by the “doctrine of precedent”, which says that higher court rulings are binding on lower courts in the same jurisdiction, and that the prevailing view is the correct one.

Some countries have common law systems that are based on customary rules and oral precedents, and that use jury trials for many civil cases. This type of system tends to be more flexible and to reflect changing social norms, but it can be less well organized than civil law systems.

In some nations, such as the United States and England, most judicial decisions are made by judges who write down their reasons for deciding cases. These written decisions become known as case law, and they help to shape future court rulings. The study of law also involves the examination of historical sources, such as legal treatises and ancient maxims.

Those who practice law are called attorneys, jurists or solicitors. Their job is to advise clients about the law and to represent them in court. They are usually trained in the law of a particular jurisdiction, such as English or American. A lawyer may specialize in a certain field of law, such as family law or criminal defense. Others might focus on transactional law or biolaw, which is at the intersection of business and the life sciences. A career in law is becoming increasingly attractive to young people. This is partly because the law can be a very satisfying career, with prestige, high pay and good benefits. It is also because the legal profession can provide a meaningful service to society. It is not uncommon for a lawyer to work as a mediator or advocate in helping disadvantaged groups. It is also not unusual for a lawyer to be involved in activism and community work. This is because lawyers are required to be impartial and non-partisan in their decisions.