When jealousy and conflicts started in the state of nature, then men felt the need to organize themselves into the organization of state to get rid of that state of nature. For this, they entered into a mutual contract. According to the contract, every man surrenders his freedom, rights and power to society because society is group of people and it is made by the people.Thus, man alienates his freedom and rights and surrenders them to society and finally gets*it back as being part of society.
According to Rousseau, the contract which was made to end the state of nature, was done by two parties. One party was man as an individual and second party was men as a collective group. According to Rousseau, men do not surrender their freedom and rights after organizing themselves into state. The keep it with themselves, but not individually, rather collectively. Being a part of society, chaos and insecurity were removed from the society due to this contract and the state originated, which is representative of general will.