For the greater good, the government cannot not always follow the will of the people. This applies especially to topics requiring much education, which is why there are experts. The general public are neither experts and cannot come up with experts on every issue likely to come up in the spotlight nor are they the government they elect. The people elect politicians and that's why scholarly experts on a range of important topics exist. For example, if a majority of people in democratic country X wanted to invade country Y for no particular reason, if it is for the greater good the government can and probably should not follow the will of the people (unless the people decide by direct vote) and pay the consequences when the election comes around.
I know it sounds like an idea that doesn't mix well with the principles of a liberal representative democracy, but the people don't always know best. However, since we are not talking about direct democracy, that is not an issue. They should be educated enough [see voter education], however, to vote for people who will make the correct, educated decision. In addition, when a public vote on an issue or referendum comes up the government should try to educate the people on said issue in a manner not partisan and of an objective educational nature. The politicians should not have to cave into public opinion on a specialized issue, like that relating to stem cells, let's say, but they might do so to help their political standing, especially if they are standing for reelection.
People elect politicians, politicians consult experts and make decisions, people re-elect or un-elect those politicians on the comparative and overall measure of their performance, etc. Alternatively, in the case of a public referendum, which are usually either local or deal with multi-national issues (like EU peoples voting on the 2005 constitution), the people decide on the issue in a more direct manner and the elected officials respond to the result of the vote.
In the end, direct democracy is usually fit only for local community governments or for large state/national issues. (In a sense, as a federal nation with a legislative direct democratic popular initiative and referendum system alongside the bicameral parliament in addition to the executive and judicial branches of government, Switzerland is an unusual modern exception.) It may be employed to let the people decide the fate of a nation, region, or province/state/governate, or local area, but for run-of-the-mill and even advanced governmental issues a more established but representative liberal democratic system works better to prevent poor decisions by the public. After all, politicians come and go as they are elected and unelected, but the electorate is there to stay, unless authoritarian rule is established — and even then the people would hold some form of collective power.
This is a post in this blog's Ideas about Democracy series.