Two different elections took place on Saturday, and the opposition won neither of them

Suppose NSW voters had gone to the polls a week earlier: before the leaders’ debate, and before the Liberals released a video of Labor leader Michael Daley making some clumsy and potentially offensive comments about the impact of Asian immigration on jobs and housing for young Australians.

What would have been the outcome?

It felt like Labor was heading for victory. At that point Daley had performed well in the campaign; his on-air rebuff of Alan Jones over the demolition of the Allianz Stadium was a defining moment. Gladys Berejiklian was criticised by her own team for not focusing voters on a defining theme. The polls suggested the state was heading for a minority government, from either side.

Then came the final week. The video showed Daley speaking frankly about the negative impact of high immigration on the employment and housing prospects of young people in Sydney — most of it true, saying things you and I could say freely, but a political leader can’t without being misrepresented and called a racist. (Daley’s choice of words was not the best, but to call him racist, for pointing out the negative impacts of high immigration, as the usually judicious Sean Kelly did this morning, is PC triumphing over common sense.)

It wouldn’t have mattered so much had Daley not then made a botch of expressing his own policies in the leaders’ debate. It was on Sky after dark, so nobody saw it, apart from political staffers. But everyone heard about it, and the two events taken together did suggest that Daley was a decent bloke out of his depth.

Did they shift the outcome, from a Labor victory to the re-election of the Berejiklian government, probably with an absolute majority? Impossible to say for sure, but quite likely.

Antony Green estimates that the Coalition will probably end up with forty-eight of the ninety-three seats in the Assembly, Labor thirty-six, with nine crossbenchers: three Greens, three Shooters and three independents. If so, that would mean the Coalition lost just four seats on Saturday on top of the two it lost earlier in by-elections.

Three of those six losses were to the Shooters, Fishers and Farmers, whose electorates now cover most of New South Wales: the vast outback seats of Barwon and Murray, as well as Orange. The Coalition also lost Wagga Wagga to an independent, local medico Joe McGirr. But it lost only two seats to Labor.

If that’s right, the Nationals have lost four seats since the 2015 election, but the Liberals just two. And in Barwon and Murray, Shooters candidates Roy Butler and Helen Dalton won by campaigning not on gun issues but on water: trenchantly denouncing the Nationals for failing to protect the Darling’s water for downstream users — farmers, fishers and people in the towns. The photos of masses of dead fish and dark water flowing out of taps sent powerful messages.

The Nationals’ water minister, Niall Blair, has shouldered the blame and will leave politics. Barnaby Joyce ought to do the same, but probably won’t.

It was apparent as soon as counting began on Saturday night that we were seeing two different elections. Parts of the bush, especially west of the Divide, were erupting against what they saw as mismanagement and neglect of their needs. But in Sydney and about half the regional seats, the government was cruising to victory.

Sydney has two-thirds of the state’s people, so its election ruled. Of all Australian cities, it is the one most segregated by income and race, so it has few marginal seats. That allows the government of the day to concentrate its defences — and this government defended its turf very well.

Across New South Wales, on both sides of politics, only a third of the seats were won with majorities of less than 10 per cent. Only one in seven seats were won by majorities of less than 5 per cent. Most seats always vote one way or other, unless an independent or minor party breaks in.

The Coalition had only two marginal seats in Sydney to defend: East Hills (on 0.4 per cent) and Coogee (2.9 per cent). Its next most marginal seat was Penrith, where Labor needed a landslide 6.25 per cent swing. It lost Coogee, but looks likely to retain East Hills and Penrith, if narrowly.

Some parts of Sydney saw big swings against the government. In the southwest, for example, Liberal-voting Camden swung by 10.3 per cent to Labor, while next door in Campbelltown Labor boosted its lead by 11.9 per cent. Just south of them, independent Judy Hannan almost broke through in the mostly rural seat of Wollondilly.

The federal seat of Hume takes in some of Camden and most of Wollondilly. The federal implications of this election were limited, but one of them is clearly for Hume MP and energy minister Angus Taylor, himself under challenge from independent Huw Kingston.

Labor also made gains on the Central Coast, including an 8 per cent swing in Gosford (at federal level, half of the marginal Liberal seat of Robertson). The Coalition’s best area was the middle-southern suburbs, where Chinese migrants reportedly aided a swing that saved East Hills, swelled the Liberal majority in Oatley, and halved the majority of Labor leadership contender Chris Minns in Kogarah. That’s good for immigration minister David Coleman, whose marginal seat of Banks covers the area.

Outside Coogee, Labor’s gains in Sydney were in votes, not seats. East Hills and Penrith were the only other seats where it came close. In Newcastle and Wollongong, the Coalition had no seats to lose anyway, unless you count the hinterland seat of Upper Hunter, which the Nationals successfully defended.

Labor’s other gain was on the North Coast. In 2015, with passions against coal seam gas mining running high, the Greens unexpectedly won Ballina and almost added Lismore. This time they held Ballina, though it looks like Labor will pip them in Lismore to claim the seat. But the Nationals beat Labor out of another on its must-win list, the urban electorate of Tweed (Heads).

In most of New South Wales, this was an election won by the defenders. One lesson is that voters like governments to build infrastructure. We saw that in the Victorian election, and while Gladys Berejiklian’s road and rail projects have been messier and more disruptive of daily life — and are still incomplete — they defined what the Coalition stood for, whereas Daley defined Labor as standing against spending a lot of money on stadiums.

By focusing so much on one issue, Labor dumbed down its message to voters, and took attention away from its policies in other areas. There’s a lesson there.

One surprise was that the Greens did better than expected. The internal turmoil that forced upper house MP Jeremy Buckingham, a moderate, out of the party after hardliners accused him of sexual violence (which he denied) had no impact on voters. The Greens retained their three lower house seats, all with big swings their way, and got even closer to winning Lismore. The negative was that in the council they seem to have lost not only Buckingham but also his seat.

The NSW Electoral Commission has released only strangely limited data on the upper house voting. It gave voting figures for just seven parties, and bundled all the others, plus the informal votes and all the votes filled in below the line, in a big heap marked “others.” Hidden in there, among other things, are the votes for Liberal Democrat David Leyonhjelm and Sustainable Australia’s William Bourke, and the votes of anyone who takes the trouble to vote for candidates rather than parties.

All we can say with certainty is that the Coalition will win at least seven of the twenty-one seats being contested, Labor six, the Greens two, and the Shooters and One Nation — Mark Latham, that is — one each. Four seats remain to be filled. On the numbers so far, the Coalition could win one of them, One Nation could win a second and the Christian Democrats and Animal Justice also have a chance.

For the Coalition, it was a landmark result in two ways. Gladys Berejiklian was already the first woman to lead a Coalition state government. (Indeed, she and Kate Carnell, as ACT chief minister in the 1990s, are the only women ever to have led a Coalition government in Australia — while Labor has had ten female leaders, in every parliament in the nation.) Now she has been the first female premier outside Queensland to be re-elected — something that was not remotely possible for Kristina Keneally when Labor elected her as NSW premier in late 2009 to try to salvage what she could from the impending wreckage. The Coalition is moving into the twenty-first century, sometimes at glacial pace.

It is also the first time in almost forty years that a state or territory Coalition government has won a third term anywhere in Australia. The Howard government did so at federal level, but the last state or territory leader to win a third term was Sir Charles Court, in Western Australia in 1980. Since then, eight Coalition governments had sought a third term, but every one was thrown out by the voters.

What made this government different?

First, it got off to a stunning start, winning a record 64.2 per cent of the two-party vote in 2011.

Second, it has been a government run by the broad centre of the Liberal Party, rather than by the reactionary right. Mike Baird certainly put voters offside by banning greyhound racing, merging local councils and privatising electricity assets, but this has generally been a government of the middle, not one driven by fringe ideologies.

Third, it has seriously tackled Sydney’s infrastructure backlog — helped by a Sydneycentric federal government that has poured money into transport projects in that city while (until recently) ignoring the needs of Melbourne.

Fourth, Berejiklian may not be the leader to make hard decisions, but she is a conscientious workaholic, and, unlike her federal leader, she comes over as a relatively sincere and sympathetic person.

And fifth, her government got lucky last week, with the Daley video and the TV debate.

Which of these five elements mattered most? You choose. •