Social Contract Theory
Social contract theory began with Plato. In the Crito (which was written by Plato) Socrates argues that it would be wrong for him to break the law by escaping from prison because he would thereby break his contract with the city-state of Athens. That contract came into being implicitly just by his choosing to stay and live in Athens. Not only is it not a written contract, it is not even an explicit verbal agreement or promise to obey the law. Not surprisingly, many people are not convinced that any such contract exists. (Socrates' idea of a contractual agreement between the individual and the state is separable from his idea that the individual owes the state a debt of gratitude for all that it has done for him or her. This seems to be a much more reasonable suggestion, but one can still wonder how much is owed to the state. That is especially true in the case of states that persecute or oppress their citizens.)
Despite this, in Plato's Republic Glaucon suggests that most people think of morality or ethics as a sort of social contract. In a perfect world I might be free to steal, lie, rape, pillage, etc., they think, but people tend to hold such behaviour against you. They dislike you, fine you, fire you from your job, etc. So we compromise. We each give up our freedom to do exactly as we please and are thus all better off. It's too bad that it has to be this way, most people seem to think (according to Glaucon), but there it is. So ethics is a burden, but one worth bearing.
Plato then tries to show that ethics is not a burden but a great good that we should love for its own sake and not only for the peace and safety it brings us.
Few people seem to have thought that Plato succeeded in this effort. Thomas Hobbes revived social contract thinking in the 17th century. The chaos and slaughter of the English Civil War led Hobbes to believe that without a state and the law and order it provides life would be "solitary, poor, nasty, brutish, and short." So people naturally and rightly come together and agree to live under the rule of a government that is strong enough to keep order. This government is to be obeyed even if it is oppressive because the alternative is even worse. What goes for politics and law goes equally for ethics. We must do the right thing because otherwise we will all be worse off.
Other social contract theorists have had different ideas about just how bad the "state of nature" (without governement) would be, and therefore just how bad a government would have to be before we could rightly disobey it. But the basic idea remains: the reason you must do the right thing (ethically and legally) is because otherwise you violate the social contract.
What does this tell us about right and wrong? That depends on how social contract theory is understood. It could be thought of as a kind of rule utilitarianism. We should do whatever is (or would be) commanded by the set of rules that make us all better off. What it means to be well off would have to be determined some way, but for a classical utilitarian it would be defined in terms of pleasure (or the absence of pain). Two problems to think about: 1) How is this a distinct theory rather than just good (or bad) old-fashioned rule utilitarianism? 2) What if the ideal set of rules involves doing something that is against the actual rules of your society (for instance what if, since most people are right-handed, it is safer if we all drive on the right, but you live in a country where the law says drive on the left? Surely the law should be obeyed in such cases, not the imaginary ideal set of rules.)?
Alternatively social contract theory might be thought of as a kind of justification of obeying the rules, whatever they might be, rather than a theory aimed at telling us what rules should exist. But then what justifies the rule that says "Don't break contracts"? Is this somehow more fundamental than the rule that says "Don't kill babies"? If so, why? And what if the rules in question require us to, say, turn our Jewish neighbours (or selves) in to the police so that they can be tortured and killed?
Another problem: How can social contract theory include those who could not possibly consent to the contract (e.g. babies, the mentally ill, the environment, etc.)? Does morality have nothing to do with how we treat them?