John Locke (1632-1704)
For Hobbes, in the state of nature rational fear drives individuals to work with one another; for Locke individuals in the state of nature are indifferent to one another (but decide that it would be easier on them to work together). For Hobbes civil society makes moral distinctions, whereas for Locke moral distinctions characterize social relations independent of civil relations: they are natural, God-given. Acting morally means acting in accord with nature, motivated by the threat of divine punishment/reward. For Locke, all human beings deserve to be treated equally and can justly be bound by civil laws (or government) only if they consent to such obligations.
Owning property (the product of one's labor), like control over your body, is a God-given right. As long as there is an abundance of goods that can be used without their spoiling, then people have a natural right to those goods. (This presupposes that goods are abundant; Hobbes assumes that goods are scarce .) Money allows someone to accumulate more than he/she can use since it supposedly does not harm anyone else. Wealth, prestige, and power are distributed justly when the people who have it worked for it or inherit it from those who worked for it: this is called a meritocracy.
In the state of nature, each person has the right to punish anyone who violates his or her rights. However, the state of nature lacks impartial judges, precise laws, and sufficient power to uphold the moral law. In order to make violations well-known and standardized and to regularize the proper meting out of punishment, we need government. Punishment aims to give someone what he/she deserves and has a right to (this is the retributive theory of punishment) and to prevent that person or others from doing similar acts in the future (this is the deterrence theory of punishment).
The political state is justified by consent of the people, who presume that the state will protect their natural rights to life, liberty, and property (which is the moral law). The people freely agree through the social contract (either explicitly or tacitly) to abide by the laws that they or their elected representatives enact: in this way they are bound by civil law. Tacit consent is given if a person chooses to live in a state or country and to benefit from the protection afforded by its laws, so no one has to make an explicit agreement to abide by the civil laws of a community in order still to be bound by them. If the government tries to take away the property of anyone in the society or to enslave the people, then the government can be justifiably overthrown because it thus fails to uphold its end of the social contract. The ultimate function of government is to protect the moral state of human beings and their natural rights (especially private property).
Jean-Jacques Rousseau (1712-78)
Humans are born free, autonomous, and naturally virtuous. For example, in the state of nature (apart from all social organization) we are naturally interested in our own welfare and are naturally compassionate about the suffering of others. However, civil society encourages us to think that we are superior to others and perverts our natural virtuous feelings, changing them into selfishness, pride, and delight in the misery of others. In civil society, being "civil" means being polite, lacking sincere motivation to care about doing what one naturally feels is the right thing.
In order to counteract the perverting effect of civil society, we should allow children to develop their natural virtues through trial and error, sensations and feelings, not theories and abstractions. Only in this way can they develop sincerity and genuine moral sensitivity in their social relations instead of acting simply for show.
In civil society moral distinctions are developed in order to handle conflicts (especially about the private property that is used to identify individuals). Government is needed to enforce the laws concerning private property, and this typically has the effect of institutionalizing moral and political inequalities. However, civility does not have to make people superficial and insincere: through public education it can guide people to resist the negative influences of society (e.g., valuing luxuries). That is why people should form a social contract, to develop their natural virtues to even greater heights than would have been possible in the state of nature.
The social contract is the tacit agreement to abide by the general will, which is what I and all others living in a community will for ourselves (even when we disagree with particular legislation). We find out what is in accord with the general will by popular votes over the course of time. That means that, on rare occasions, the majority in a popular vote will not be consistent with the general will. When that happens, even if I am in the majority, I would not be acting in accord with my will and thus not be free. In order to be free as a citizen, I will the law for the common good. I am thus obligated to obey the law not because it is imposed externally but because I impose it on myself directly and not through an elected representative.