How is liberty a social contract?
It is much more common to say that liberty is part of the social contract than it is to say that liberty is a social contract. Liberty comes about, according to some political philosophers, because people agree to participate in the social contract.
Without the social contract, people do, in a sense, have complete liberty. In a state of nature there are no rules or laws to tell people what they may and may not do. That being the case, we could say that people have complete liberty.
However, if we stop and think about it, the picture is very different. When there is no law, you only have whatever liberty you can defend by your own physical power. You have the liberty to own property, for example, but only so long as you can prevent other people from stealing that property. Without law, society is a free for all with everyone taking as much as they can.
If we think of things in this way, we can see that true liberty only comes about as part of the social contract. People get together and agree to give up some of their liberty to a government. They agree, for example, not to try to steal from others. They agree (in a society like ours) not to get drunk in public or to use drugs. In exchange for losing these freedoms, however, they gain much greater freedoms. In our society, the government protects the people’s major rights. It prevents others from taking their property. It prevents others from enslaving them. It prevents others from killing them. In this way, the government allows people to have greater liberty than they would if they had not agreed to a social contract.
Thus, we can say that liberty is part of the social contract because the government protects people’s most important liberties when they enter into the social contract.
Efforts to provide unlimited liberty to members of a society are counterproductive to that society in that to do so would result in societal confusion and chaos. Thus, government establishes laws which limit the actions in which members of society can become engaged and in exchange for the removal of some liberties by laws, the government warrants security and safety for members of society. This is the basis of the "Social Contract" developed by Hobbes.