Demagoguery is delicate, persistent problem in any theory or implementation of Liberal democracy. On one hand, Liberalism holds the ideal of public participation in governance as sacrosanct. Citizens needs to have some say in how things are run, if only to protect their own individual rights and interests, otherwise the system ceases to be Liberal in any meaningful sense. On the other hand — as everyone from Aristotle onwards realized — the public at large can be gullible, temperamental, stubborn, ignorant, or driven by rampant emotions, all of which can make them particularly ill-suited for political decisions. Maintaining a balance between this idealistic drive towards individual participation and this sour but reasonable fear of the lemming-like tendencies of human tribes is key. But this key point is difficult to conceptualize, much less implement.
The standard practical solution, at least since the end of the 18th century, has been to implement some form of Madisonian democracy. Madison reasoned (see Federalist 10) that since we could not stop a faction (a tribe) from forming or spreading without damaging the rights of individuals to participate freely, we should instead introduce what amount to fire-breaks: institutional structures that spread power over many different locations, that slow down political decision-making, or that otherwise break up the capacity of a faction to quickly and easily grab power through emotional manipulation. The underlying assumption is that the harder and longer a faction has to work to gain power, the more that emotions will fade and be replaced by pragmatic concerns and rational interests. Congressional districts were meant to keep hot-headed movements localized, so they could only capture a small number of seats in the House; The Senate was meant to be overly deliberative, to slow down the passage of bills until the movements that spawned them lost steam; the Electoral College was meant to be an elite body that could nix the popular vote if the popular vote fell in line with an noxious faction. Madison's solution is elegant and effective within its limits: not perfect by any means, but (to slightly misattribute Churchill) better than all the others that have been offered.
Unfortunately, we started to see the limitations of Madisonian democracy in the 1930s, with the rise of mass media. Mass media creates the opportunity for propaganda on a wide scale, and the manipulation of emotional reasoning that lies at the heart of propaganda began allowing factions to extend their reach across wider ranges of the populace. This has systematically broken down the fire-breaks that Madison built into our 18th century system. Each innovation in mass communication allows smaller factions to reach and incite larger populations, and to keep inflammatory viewpoints in the public eye for longer durations, so that the containment and cooling down strategies Madison relied on lose their effectiveness.
Unfortunately, political thought is still in the 'analyzing the problem' stage, and I have not yet seen many solutions proposed. As I've seen it, there seem to be two common themes running through the literature:
- Proposals about revitalizing the citizenry so that the mass public can (in one way or another) push back on factions and reduce their influence. Habermas was wrestling with that in "Between Facts and Norms", and you can find that thread running through European Social Theory more generally.
- Proposals that try to hobble factions directly: campaign finance laws, term limits, proportional representation models, anti-gerrymandering efforts, etc.
The first have not come into any focus clear enough to implement, and second always seem to come up a day late and a dollar short.
My own pet theory (in the US context) is that we ought to establish a quorum system for public voting: mandate that the winning candidate in any election has to win a majority of everyone entitled to vote in his district, or the election is null and void. That ties leaders to their constituents strongly: they cannot afford to ignore, disparage, anger, or disappoint any of their constituents in favor of some factional interest, because all constituents have to do is not vote and the leader will lose his job. That puts politicians and parties in the position of having to encourage, inform, educate, and serve their constituents (just to ensure that the maximum number of people show up at the polls); this in turn will gradually improve the political literacy of the population as a whole, making them more capable at political decision-making.
But I'm not holding my breath on that being implemented...