El Salvador’s presidential election is not yet final, although nothing looks likely to upset the victory of Salvador Sánchez Cerén, candidate of the governing Farabundo Martí National Liberation Front (FMLN). When preliminary results were finalised yesterday he led by 6,634 votes from his centre-right opponent, Norman Quijano.

According to the New York Times, an official from the electoral tribunal “explained that the tribunal would need to review blank and contested ballots and complete counting the 10,500 absentee ballots cast by Salvadorans living abroad.” The BBC report quotes another official saying “We will give the people the legitimacy it demands from these elections by recounting every single vote,” which sounds rather different, although it also misstates the margin as 6,357 votes.

Either way, it’s perfectly reasonable for Quijano to not yet concede defeat. But his references to (unspecified) “fraud” and somewhat ominous invocation of the military are less justifiable. For a country that tore itself apart in a civil war in the 1980s, El Salvador has done a remarkably good job of reconciliation; it doesn’t want that jeopardised by a disputed election.

But El Salvador wasn’t the only country voting on Sunday. North Korea also held elections, for the 687 members of its Supreme People’s Assembly, the country’s legislature.

In reality, of course, the legislature is an irrelevancy: North Korea is a dictatorship, with no challenge permitted to the absolute rule of Kim Jong-un. And the election certainly reflected that, with only one candidate for each seat. Voters simply had the duty of writing “yes” or “no” beside the candidate. The only result released so far is from Kim’s own constituency, which claims a unanimous vote in his favor.

No-one is holding their breath waiting for the other results. We know that the reported “no” total will be vanishingly small, and that probably reflects the reality reasonably well. Dissent in North Korea is not a good career move, and it’s hard to see why anyone would risk it for the sake of a powerless legislature.

Media reports mention that the only real interest in the election is seeing who the regime puts forward as its candidates, providing clues to their rise and fall in the hierarchy. (This year the big thing is the emergence of the dictator’s younger sister, Kim Yo-jong, in a prominent position.)

But that’s not quite true. It’s also interesting, in a way that we often fail to realise, that North Korea bothers to hold elections at all.

Once upon a time, autocrats never considered running elections, even sham ones. Democracy was something to be demonised, not copied. The czars of nineteenth century Russia, for example, were confident in their absolutism, much like the rulers of present-day Saudi Arabia (although even there there has been some softening).

It’s not the least of democracy’s victories that even its most inveterate enemies now pay lip service to it. Popular approval, real or fake, has become the universally accepted test of legitimacy. Kim Jong-un surely isn’t fooling anyone, but at some level he still wants to be able to claim to be a democrat. It’s even in the name of his country, the Democratic People’s Republic of Korea.

So while in one sense nothing could be further from the hotly contested election in El Salvador than the rubber-stamp poll in North Korea, both in their ways are signs of democracy’s triumph.

The final irony is that both victors, Salvador Sánchez Cerén and Kim Jong-un, would be labelled on the right as “communists”. But although they share a vaguely Marxist background, Sunday’s contrasting events are enough to show that they have little else in common.