Law shapes politics, economics, history and society in many ways and is a mediator of relations between people. Its precise definition remains controversial but can be described as a set of rules made and enforced by social or governmental institutions to regulate behavior. Legal systems vary widely, from those where a legislature codifies and consolidates its laws to those where judges, in deciding disputes, rely on a body of judge-made precedent. Religious laws also play a significant role, particularly Islamic Shari’a law.
Legal philosophy tries to determine whether law should or shouldn’t comprise precepts that are of particular import, and it also addresses the question of how the laws should be interpreted and enforced. The law can serve several purposes in a nation: it may keep the peace and maintain the status quo; protect minorities against majorities; promote social justice; or facilitate orderly social change. Some governments have done better at some of these goals than others; for example, an authoritarian government may keep the peace but also oppress minorities and political opponents.
Other important aspects of the law include espionage; censorship; crime and punishment; and war and the military. The law can also govern immigration; nationality; family; and transactional matters such as contracts and property. Laws may be enacted to protect intellectual property, and they can impose a variety of restrictions on trade. Other societal concerns that the law can address include environmental and human rights. In the context of criminal law, it is common for courts to order a defendant to pay fines and/or fees to compensate victims.