Rosseau viewed the state of nature as peaceful with man being free. However, as society grows and people become dependent on each other, a social contract is necessary to overcome conflict. He argues that man is subdued in chains once becoming part of society, losing that natural freedom and peace.
Therefore, in order to achieve that freedom again, the individual must live in a civil society that ensures the rights and freedoms of its citizens. That is the social contract, where people must submit to the general will and seek to uphold the common good, while simultaneously gaining peace and freedom that is attained in nature.