Law is a set of rules that are created and enforced by social or governmental institutions to regulate behavior. Its precise definition is a matter of longstanding debate, and it has been variously described as a science and as the art of justice. Laws can be based on many things, including custom and practice, as well as governmental authority or the command of military forces. Law can be general or particular, and it can be enforceable or unenforceable.
A common view is that law operates best if it is a relatively stable set of norms available as public knowledge, so people can study them and internalize them and figure out what they require of them. This view is called the Rule of Law, and its components include the independence of legal institutions and procedures from political or corporate control; the transparency of government business; the accountability of public officials; and the integrity of legal processes.
Laws are generally made by a government, and they can be enforced by that government’s military or its police force. However, laws can also be set by religious or social organizations and may be self-enforcing. Moreover, laws can be a result of aspirations to certain kinds of behavior, such as the desire for greater rights for citizens. The principal function of law is to establish and enforce the limits on the power of individuals and groups over other people, and to protect them from abuses of public or private power.