Garvan Walshe is a former National and International Security Policy Adviser to the Conservative Party. He runs Brexit Analytics.

In the West’s civil war of ideas the front has shifted to Warsaw. There, the government run by a party that calls itself Law and Justice has launched an all out assault on both. It relies on the cynical argument that “unelected” judges represent an “elite” and a bare parliamentary majority, obtained on a minority of the vote, the authentic voice of the “real” people.

Applying iron party discipline, that is centralist without being democratic, it has rammed laws through the parliament that give the justice minister the power to dismiss Supreme Court judges and appoint the presiding judges of lower courts. This flagrantly unconstitutional legislation would normally have been struck down by the Constitutional Tribunal (a separate body from the Supreme Court) but the ruling party, known as PiS after its initials in Polish, had previously exploited a loophole in the constitution to change its procedures so they have become almost impossible to use.

All this has driven hundreds of thousands of Poles onto the streets in protest. Yet state television, which has been purged of independent journalists, has denounced this peaceful exercise of the right to assemble as a “coup”.

It is not, of course, the citizens of Poland who are mounting a coup, but the ruling party, having won under 38 per cent of the vote, on the orders of a man who holds no public office, the former prime minister Jaroslaw Kaczinski.

The president, Andrzej Duda, previously thought just to be a figurehead for the ruling party, has now vetoed two of the three laws. The third, which would allow the justice minister to appoint the presiding judge on all lower courts, is set to be approved.

Despite those vetoes, Polish democracy is still at risk from anti-legal populists. The proximate cause is Kaczinski’s power grab. The enabling factors are that Viktor Orban has done the same in Hungary, and Trump wishes he could do the same in America. But PiS’s attacks gain legitimacy from a global anti-judicial populism that has spread from the left to the right. It begins with a superficially attractive slogan: laws should be made by the people’s representatives, not unelected judges, but is inadequate to the complexity of the modern state, and gives far too much power to unelected powers behind the throne, whether party leaders like Kaczynski, or unelected advisers in Number 10.

If the UK or Poland still retained a legislature like Britain had in the 18th and 19th centuries, where MPs, though forming political blocs, were mainly independent persons accountable primarily to the voters in their constituencies there would be a case for the populists’ theory. Then, parliamentarians were free think for themselves and had to present arguments on the floor of the House to which their colleagues would listen. Laws were fewer but more thoroughly debated. They didn’t nod them through because a party leader told them to.

This isn’t how any modern system works. A contemporary parliament is a place where parties, not individuals, compete. An administration, commanding the confidence of the parliament proposes laws, and the opposition usually opposes them to build its case for the next election. If the electoral system leads to coalitions, laws are negotiated between governing parties, and then pushed through.

I don’t mean this as an attack on representative government. A “political market” where different parties compete for votes and approval like firms competing for market share has worked tolerably well, at least compared to other systems, but it deviates too far from democratic principle to derive moral legitimacy from election rather than performance.

And, like a real market, it relies on strong competition to ensure high quality service. The public don’t design their own cars or administer their own healthcare. They trust the implementation to experts, only making judgements about their effects. It would be absurd to specify the design of, say, a fuel injection system or cancer drug by majority vote, but isn’t impossible to allow people to choose between car manufacturers (or, in Poland at least, competing health insurance providers).

But political markets, like all markets, are liable to abuse by monopolists. As Volkswagen falsified its diesel tests, governments try to get away with abuses of power. The political market can provide overall checks, but this control on complex modern governments needs to be supplemented by legal controls on the details of public administration. We need much more administrative law because we have a much more administrative state.

Potential monopolists of course resent these restraints on their power. That’s why PiS asserted direct control over state media and has attacked the judiciary. It is also why the British government, then possessed of a majority in the House of Commons, instructed their lawyer in the Article 50 case to argue that a resolution of the House of Commons, and not an Act of Parliament, would be enough to extinguish rights that the European Communities Act had conferred on British citizens.

Had either constitution worked as the theory suggested, those blatant assertions of executive power would never even have been considered. But party leaderships, elected at most by party members, exercise power over the careers and in an age of professional politicians, the financial futures, of MPs. In these circumstances legislators aren’t independent. Far from representing the will of the people, they are required to represent the will of the party chiefs and their appointed servants.

The populist argument against judicial “law-making” – whether made by the Daily Mail describing the English High Court as “Enemies of the People,” the Polish state media describing the Polish demonstrators as conducting a “coup”, or even in high intellectual form by Professor John Finnis – relies on imagining an independent legislature outside party control that no Western democracy actually has. In these last few weeks, anti-legal populists came very close to extinguishing freedoms that the Polish people had finally won fewer than 30 years ago. Whether the product of cynical lying or innocent self deception by people who ought to know better, theirs is a dangerous argument. Anyone who believes that democracy is based on the rule of laws, and not men, must expose it for the cant that it is.