This concept of Government was derived from the political philosophy of John Locke, which contended that people were generally capable of self-government and honoring the unalienable rights of others. Because of possible disputes, and the occasional aberration of evil men, the formation of a government to secure the universal rights was advisable, both from enemies within and beyond our borders; but that such a government only derived its ongoing legitimacy from the consent of those it governed.
Locke's contemporary, Thomas Hobbes, had a different view of mankind. He saw men as brutes, who only recognized their own right to take whatever they could from everyone else, in a law of the jungle, survival of the fittest kind of dynamic. In Hobbes' view Government was needed to order the resulting chaos. He advocated a strong monarchy or dictatorship type government not responsible to the will of the people (as that "will" would just be a collective attempt at usurping the power to return to a state of chaos). Men left to their own natural leadings would always and only act in self-interest, and not in accordance with any sense of principle; as such they required a powerful central government to impose order on them.
So in Locke's philosophy, Government was necessary only in a limited fashion, not to impose it's will on most normal citizens, but to protect the majority of it's people from the occasional villain, or foreign threat. Hobbes saw every man as a brute in need of government to regulate him. Traditionally, we have leaned toward the position of Locke, trusting in the goodness of our fellow citizens; but the shadow of Hobbes has always been there in those who insist that all of society must be thoroughly regulated and controlled to check the brutish, greedy nature of all men.
I will leave the argument of who was more correct, Locke or Hobbes, for another day. We as a nation chose Locke, and for the time being, that choice (and I do believe it to be a good choice) is still the guiding principle by which our Government exists. That Government yet derives it's power, and hence it's legitimacy from the consent of the governed. That, of course, is not to say that the government needs to be altered or abolished every time one or even several of it's citizens disagrees with what it does. We generally run the nation by the rule of the majority, and this we deem to be "the consent of the governed". Just the same, every time the government institutes an action not supported by some of it's citizens, those few citizens do not feel that their government is representing their views.
Consensus is always good, but realistically seldom possible in a large and diverse nation. Just the same, the degree to which a Government approaches representing a consensus, is the determinant of the degree of that Government's legitimacy on any given issue. If a government institutes a law against the molestation of children, it will likely achieve a near consensus of consent except for the few kooks from NAMBLA and other predators. On this issue the government would be highly "legitimate". On the other end of the spectrum the government might institute a law prohibiting alcohol nationally. Of course, Prohibition, though legally enacted, hardly represented a consensus and created quite a mess, eventually being repealed. In such a case, though the government is technically still legitimate, it is barely so, and has caused a great division in the nation. On certain issues such a division might indeed be justified, but they should be exceptionally rare, because such divisions can tear a nation apart, as was the case with our own Civil War.
IMHO: The consent of the governed is best served by consensus, and patience and education better serves this purpose than bullying and coercion for most issues. Since even general consensus is difficult to achieve, government intervention should generally only be applied when absolutely needed, and otherwise the engineering of society should be left to the good and free will of the people who comprise it.
"That government which governs best, governs least."