Locke's believe that human beings have a natural moral sense which is governed by the reason. He also disagrees with Hobbes about the state of nature, which in Locke's point of view is a "state of Liberty and of Equality" so that all people are free and equal. Though people have unlimited liberty to have self-control over their own person or property, they have not the right to harm themselves or anybody else under their control. That state of nature is in Locke's viewpoint a moral state where people live in harmony with God's will and reason. Since each individual possesses natural rights, the state of nature is a "self-adjusting" system. Therefore, you can't just go and kill someone, because you have the morality to preserve your fellowman live unless it is your life at stake, then you are entitled to preserve yourself. It is only justified to punish somebody when the person violates your natural rights.
Following these assumptions of the human nature and the state of nature, both thinkers are drawing out different views of what the social contract means. Under Hobbes point of view, people enter the society for the reason that they all feel vulnerable in a the state of nature, which is war. Hobbes thinks that the state of nature is so unbearable, that people are looking for a more secure environment. As people are rational, they understand that they are better living in a world with moral rules than without. As an agreement, people trade some of their freedom and liberty of decision making for the security and peace they looking for. One person or a group of people is given the power to protect the rest of the society. A government is created, according to Hobbes, to protect people from their own selfishness and wickedness. .
In fact, Hobbes believed that a society, is be better governed as a monarchy, because he felt a country needed an authority figure to provide direction and leadership.