The opinion polls don’t always get it right. Even in developed western democracies, where you’d think polling technique would be pretty well refined, upsets still happen. At least that’s the lesson from Tuesday’s election in British Columbia, the westernmost province of Canada.

Canada has a rather unusual (and changeable) multi-party system, but in British Columbia it turned out to be basically a two-horse race between the incumbent Liberals and their challengers to the Left, the New Democratic Party. Federally the Liberals are a centrist to centre-left party, but at the provincial level parties can be quite different; with their main opponents on their left, the British Columbia Liberals are more of a pro-business centre-right party, not unlike Australia’s Liberal Party.

The opinion polls were clear that the Liberals, in government since 2001, were heading for defeat. Even last week they were still up to nine percentage points behind the NDP. In March the gap had been as much as 20 points.

Yet when the results came out yesterday, the Liberals had retained government quite comfortably, actually increasing its majority: they finished with 50 seats (up one on their 2009 result) to the NDP’s 33 (down two). The Greens won a single seat (their first), and there is one independent.

The victory was tarnished slightly by the fact Liberal leader and premier Christy Clark lost her own seat, but this doesn’t seem to be a major concern. Some loyal member with a safe seat will almost certainly resign and allow her to return via a by-election (another oddness about Canadian practice).

Canada has single-member electorates and first-past-the-post voting, which can sometimes mean that seats won bear a tenuous relationship to votes cast. (British Columbia has twice defeated referendum proposals to introduce proportional representation.) But that doesn’t seem to be the case here: the Liberals had a clear lead in the popular vote as well, with 44.4% against 39.5% for the NDP. Both were down only slightly from their 2009 figure. (Minor parties, of course, still lose out: the Greens needed 8% of the vote to win their one seat.)

So does this result give hope for unpopular governments elsewhere? The similarities between Canada and Australia are often noted — could it mean the Gillard government, which has never been as far behind in the polls as Clark’s Liberals were, is still in a position to stage a comeback before September 14?

All polling is subject to error, both statistical error and the more serious sort that comes from voters changing their minds. With a deficit averaging about 10 or 12 points in recent polls, the federal ALP is certainly not beyond hope. Nonetheless, there are reasons for thinking that the sort of turnaround that can happen in Canada is much less likely here.

Antony Green considered the question in a story yesterday, in which he pointed to compulsory voting as a major reason why Australian elections are more predictable and less volatile. That’s very true: optional voting makes a pollster’s task much harder, since they have to factor in how likely people are to vote, and a party’s ability to motivate and organise its own voters (its “ground game”, as the Americans say) can be just as important as its relative popularity.

But first-past-the-post voting also has an impact, by making swings more sudden and dramatic. That’s because people vote tactically: being unable to express preferences, they have to try to make their one vote count, which may mean voting for someone who is less then their ideal choice. That’s often something that you can only determine very close to polling day.

So in British Columbia, for example, the Conservative Party managed only 4.8%, up on their 2009 performance but less than half what the polls were giving them a few weeks ago. Clearly there were a lot of centre-right voters who felt more at home with the Conservatives but realised that that would mean a wasted vote, so switched to the Liberals at the last minute.

Parties in a first-past-the-post system can therefore find the ground falling away from under them very quickly, in a way that tends not to happen in preferential or proportional systems.

Even allowing for the difficulties, this is an extraordinarily bad result for the pollsters. Eric Grenier, Canada’s answer to Nate Silver, wrote: “There is no reason why this should have happened, which leads me to believe that the reason it happened is because the pollsters did a bad job.” He remarks glumly that “it puts into question the validity of the work I do”.

Australian opinion polling has a much better record, and there is no evidence that anything like this sort of upset would happen here. Then again, upsets tend to happen — by definition — without warning. Perhaps that’s the most consolation the Gillard government can take from Canada.