Justice is the legal or philosophical theory by which fairness is administered. The concept of justice differs in every culture. An early theory of justice was set out by the Ancient Greek philosopher Plato in his work The Republic. Advocates of divine command theory argue that justice issues from God. In the 17th century, theorists like John Locke argued for the theory of natural law. Thinkers in the social contract tradition argued that justice is derived from the mutual agreement of everyone concerned. In the 19th century, utilitarian thinkers including John Stuart Mill argued that justice is what has the best consequences. Theories of distributive justice concern what is distributed, between whom they are to be distributed, and what is the proper distribution. Egalitarians argued that justice can only exist within the coordinates of equality. John Rawls used a social contract argument to show that justice, and especially distributive justice, is a form of fairness. Property rights theorists (like Robert Nozick) take a deontological view of distributive justice and argue that property rights-based justice maximizes the overall wealth of an economic system. Theories of retributive justice are concerned with punishment for wrongdoing. Restorative justice (also sometimes called "reparative justice") is an approach to justice that focuses on restoring what is good, and necessarily focuses on the needs of victims and offenders.
Understandings of justice differ in every culture, as cultures are usually dependent upon a shared history, mythology and/or religion. Each culture's ethics create values which influence the notion of justice. Although there can be found some justice principles that are one and the same in all or most of the cultures, these are insufficient to create a unitary justice apprehension.
In his dialogue Republic, Plato uses Socrates to argue for justice that covers both the just person and the just City State. Justice is a proper, harmonious relationship between the warring parts of the person or city. Hence, Plato's definition of justice is that justice is the having and doing of what is one's own. A just man is a man in just the right place, doing his best and giving the precise equivalent of what he has received. This applies both at the individual level and at the universal level. A person's soul has three parts – reason, spirit and desire. Similarly, a city has three parts – Socrates uses the parable of the chariot to illustrate his point: a chariot works as a whole because the two horses' power is directed by the charioteer. Lovers of wisdom – philosophers, in one sense of the term – should rule because only they understand what is good. If one is ill, one goes to a medic rather than a farmer, because the medic is expert in the subject of health. Similarly, one should trust one's city to an expert in the subject of the good, not to a mere politician who tries to gain power by giving people what they want, rather than what's good for them. Socrates uses the parable of the ship to illustrate this point: the unjust city is like a ship in open ocean, crewed by a powerful but drunken captain (the common people), a group of untrustworthy advisors who try to manipulate the captain into giving them power over the ship's course (the politicians), and a navigator (the philosopher) who is the only one who knows how to get the ship to port. For Socrates, the only way the ship will reach its destination – the good – is if the navigator takes charge.