Democracy in the Middle East continues to be something of a hard slog.

Syria’s civil war appears to be intensifying, and although the opposition is expressing optimism it’s hard to imagine things getting better soon. The Gulf states continue their suppression of dissent — most recently in Oman. And Egypt is still facing a struggle for power between its newly elected President and the powerful military.

But Libya this week looks like a good news story. Results from the first post-revolution election, held the weekend before last, show a clear victory for the moderate-liberal grouping of interim prime minister Mahmoud Jibril, the National Forces Alliance. The NFA won 39 of the 80 party-list seats with 48.8% of the vote — more than double that of its nearest rival, the “Islamist” Justice and Construction Party.

This isn’t quite as sweeping as it might seem: there are also 120 constituency seats, filled by nominally independent candidates, and it’s been suggested that a greater portion of them might line up with the Islamists. Nonetheless it’s a very strong showing for Jibril, who has called for a broad-based coalition government, and a contrast to the recent Islamist victories in Egypt, Tunisia and Morocco.

It’s always risky to speculate on why people vote the way they do, but two factors come to mind that might explain the difference.

First is simply the example of other countries, and especially Egypt, Libya’s influential neighbour. The fact that the Egyptian presidential election, after so much anticipation, came down to a choice between an old-regime holdover and a conservative Islamist was a major disappointment to many. Although the country’s democratic forces seem to have rallied behind the Muslim Brotherhood’s Mohamed Morsi, there are still major difficulties ahead.

It would be reasonable, even if not entirely fair, for Libya’s voters to conclude that giving too much power to the Islamists was a recipe for confrontation and that national unity would be better served by more secular forces.

The second factor is the nature of the regimes that the revolution overthrew. Egypt and Tunisia (and for that matter Syria) followed the same basic model: a secular autocracy that kept control of the levers of power but otherwise allowed civil society to function, with scope for religious organisations and for limited expression of political dissent.

In that environment, the Muslim Brotherhood easily became the most well-organised opposition force, and generally enjoyed a sort of grudging toleration. It could even be useful to the regime — particularly in Egypt, where Hosni Mubarak repeatedly succeeded in convincing American policymakers that the only alternative to his rule was Islamic extremism.

Libya under Colonel Muammar Gaddafi, however, was a much more pervasive tyranny.

The regime’s tentacles extended throughout Libyan society, with little civil society to speak of and no opportunity for independent centres of power to develop.

So when Gaddafi was finally deposed, the opposition were all pretty much starting from scratch, trying to upscale local tribal alliances into national political movements. In doing that, the Islamists had no special advantage, so they lacked the head start they’d been able to take advantage of in Egypt and Tunisia.

But the encouraging thing about Libya is not so much who wins but the fact that a democratic transition seems to be proceeding smoothly.

Regular authoritarians get replaced by democracies all the time (see the past 30 years in South America); that’s now a relatively well-worn path. But the fall of maniacal regimes such as Gaddafi’s is often a signal for prolonged instability and ultimately the emergence of a new dictator.

So far Libya is doing well: a relatively peaceful election, high turnout and a mandate for moderate forces. But if there’s one thing we know about democracy, it’s that there will probably be more surprises in store.