Government is the system by which a community or nation is controlled and regulated. Governments vary in their composition and processes. Capitalist liberal democracy] is currently the dominant method of governance in the Western world - whereby citizens are allowed to vote for one or more representatives to join a senate, parliament or other voting body who can make decisions about legislation. Other forms of government include dictatorship, Communism, anarchism and theocracy. Various thinkers have put forward theories as to how governments have come to exist and justifications for their necessity.
For many governments, they are often seen as justified in the natural order, or by divine command. In the Western world, rule by the monarch (in combination with ecclesiastical authorities like the Pope) was justified by the idea of the Divine Right of Kings - that God has ordered the world so that the monarch is chosen by God to rule over the nation. During the Enlightenment, many came to question these views, including John Locke and John Milton.
Modern democratic rule stems from both the Enlightenment and from the ancient world. City states like Athens at the time of Socrates had a democracy - in as much as only adult men who had completed military training could vote in a direct democratic process. The impracticality of direct democracy for large numbers, and doubts as to people's ability to comprehend the complexity of law and policy were given as a reason to the use of representative democracy, such as we see in most Western nations today. This has a variety of different forms - the United States has two elected chambers, the House of Representatives and the Senate, while other countries have mixed elected and unelected governments, like the United Kingdom which has an elected lower house, the House of Commons, and an appointed House of Lords.
Some of the ideas which accompany modern democracies include the rule of law - that is to say that there is one code or body of law which applies equally to everyone, without exception or favor to any particular individuals. This idea is codified in many constitutional legal documents like the United States constitution and Bill of Rights, the Magna Carta and in the philosophical work of Plato, Aristotle and Thomas Aquinas. From the rule of law come other democratic ideals - the presumption of innocence, habeas corpus and double jeopardy. Another key idea in modern democratic theory is that of the separation of powers, splitting up the various stages of creating, implementing and enforcing the laws. In the United States, for instance, this is done by splitting the legislative branch (Congress and the Senate), the executive branch (the President, Vice-President and their appointees) and the judicial branch (judges which, although appointed by Presidents and approved or vetoed by the Senate, are in power until they die, retire or are removed from the bench). Within most modern democratic governments, there are people who operate without political interference - those in the Civil Service in Britain are supposed to remain politically neutral.
 Social contracts: the justification of government
Democratic government is justified as being the collective will of the populace. Government, it is said, is done by the consent of the government. In voluntary associations like clubs, societies and businesses, the power structure is justified by the fact that all people joining the organization choose to be bound by it's rules and governance structures. When the same is argued with regard to governments, many are skeptical - pointing to the fact that a person is born in a particular country and have never been asked whether or not they consent to being governed.
Various theories have been put forward explaining the formation and justification of governments. One large school of thought is that of presumed or tacit consent - that since one enjoys the privileges of living in a particular country by, for instance, using it's social services, or enjoying it's fruitful economic conditions, one consents implicitly through using those fruits. Opponents of this idea argue that in many cases, they do not consent to something when they are socially coerced into using such services. For instance, a child does not consent to going to school, he is coerced (with the justification that getting an education is good for him) - but by attending school, he does not necessarily consent to the government that created the school for him to go to.
This theoretical agreement has been termed the social contract and is, broadly, an agreement between men to limit the exercise of their own freedoms to harm each other so that a more stable and secure society can exist. This ideas originated with Thomas Hobbes and has been refined by philosophers including John Locke, Jean-Jacques Rousseau and Pierre-Joseph Proudhon.
In the twentieth century, a new approach to the social contract was pioneered by the American political philosopher John Rawls, who suggested as a thought experiment in A Theory of Justice, an original position where we would be placed. People in the original position would be asked exactly how they would like society to be structured without knowledge of the position which they would find themselves in - what Rawls called the veil of ignorance. From this position, he noted that people would choose a society consisting of two principles - firstly, a wide distribution of liberty, allowing liberty to everybody so long as that liberty does not threaten the liberty of anybody else, and secondly, social and economic inequalities being arranged so that they are of benefit to the least-advantaged, and so that such inequalities are accessible to all in an open manner. This latter principle deals with, for instance, the fact that a doctor is paid more than someone else in society can be justified on this theory, only if the doctor provides his services to help the least advantaged, and the process by which one becomes a doctor is clear and open to all who want to try.