Rousseau's ideal system of government is an example of what's called social contract theory. There are a number of different variations on the social contract theme in political thought, but they all share the same basic assumption—that the exercise of political power is based on some kind of agreement between the governors and the governed. In most cases, social contract theory is concerned with limiting the power of the state, although Hobbes's vision of government is an obvious exception here.
Rousseau believed in popular sovereignty, the idea that power ultimately resided with the people. This may not seem particularly radical today, but, in Rousseau's time, most states were ruled by absolute monarchs. They alone enjoyed political sovereignty. The political role of the people in such states was limited, and, even then, "the people" tended to mean a wealthy, property-owning elite.
The ideal state, for Rousseau, gives expression to what he calls the general will. This is the collective will of the state's citizens, putting aside their selfish interests to achieve the common good. Unlike in a modern democracy, the people don't come together to debate certain issues and then thrash out a solution or compromise; instead, they reflect on their interests as citizens, rather than as individuals. The interest of each citizen qua citizen is always justice and the public good. In that sense, the general will of a public assembly isn't artificially constructed or imposed; it emerges naturally from each citizen, reflecting rationally on the good of all.
In this ideal state, the law always expresses the general will. That being the case, any individual who breaks the law is acting against his or her interests as a citizen. Lawbreakers are not just attacking the instituted government; they're also acting against a higher interest than that of the self-seeking individual.
A number of scholars down the years have drawn attention to what they see as the potentially authoritarian implications of this particular aspect of Rousseau's political thought. In a notorious passage of The Social Contract, Rousseau states that individuals sometimes need to be forced to be free to get them to obey the law. The idea that someone can be forced to be free sounds rather ridiculous, sinister even. But we should remember that, in Rousseau's ideal state, the government is the expression of the will of all. So in forcing someone to be free, the government is simply bringing the individual lawbreaker back to his or her true self—a rational decision-maker who's chosen the system in which they live, one consistent with the dictates of justice and the common good.