On 26 March the New South Wales Labor government suffered a shattering defeat in the state elections. It won only 25 per cent of the votes, lost 32 of its 52 seats – one to the Greens and the rest to the conservative coalition – on swings against it of up to 35 per cent. Much of its heartland was lost and will be difficult to regain. It was the worst defeat in its history: even worse than in 1932, when the party succumbed to a major economic and political crisis.

This was more than just a defeat in one part of a not terribly important country. New South Wales has a larger population than several EU states, and Sydney is bigger than most European capitals. More of Sydney’s workforce is born overseas than in any European capital, with the possible exception of London. And the New South Wales Labor Party is probably the oldest, most precocious and most successful working-class party – at least with a continuous history – anywhere in the world. It has governed New South Wales for most of the last century, including for the past 16 years. Only four years ago it had an easy victory in the state elections. Deceptively easy, as it turned out.

Some reasons for the defeat are local to New South Wales. Others, however, are not. Like many working-class parties, the NSW Labor Party has been characterised by a powerful party machine, and Sussex Street has historically been very successful in mobilising not only the working class but also important sections of the urban and rural middle classes. The system has always depended on patronage and clientage: often in a big way. The party has had complex relations with the state’s betting and drinking interests, and with the Roman Catholic church. The NSW Labor Party (and the Australian Labor Party more generally) differs from most other social democratic parties, however, in the historic significance of the trade unions inside the system and in the easy movement of people between industrial and political labour. There has always been tension between the machine and the parliamentary Labor Party but over the long term there was a fairly productive balance.

The system not only mobilised the vote but also guaranteed reasonably progressive and competent government. New South Wales was conspicuously better governed than states (such as Victoria) where the conservative parties were predominant, and Labor identified itself with the ambitions of ‘ordinary’ voters remarkably well. So what went wrong? One factor, it could be argued, is the decline in the industrial working class and consequently in union membership. Yet I doubt if that was fatal. Deindustrialisation has not had much effect on overall voting patterns in Australia – which have been remarkably stable since the emergence of Labor and anti-Labor parties in 1910 – because the Labor Party has been able to preserve its status as a ‘progressive’ party via a coalition of interests, predominantly but not only working-class. That status, however, collapsed in New South Wales over the last four years, culminating in last month’s debacle.

Here perhaps the story becomes more familiar. In New South Wales, the decline of the industrial working class was accompanied by the collapse of the Labor-reformist ideology, which was a product of the old demography. In the best neo-liberal way, Labor governments became obsessed by budget surpluses, refused to borrow for infrastructure projects and became notorious for cancelling programmes once thought to be indispensable. In other words, the government became incapable of working the old patronage networks because it had nothing to give its clients.

The decay of reformism also opened the Labor Party to a destructive factionalism. Australian politics, both Labor and non-Labor, have always been much more factionalised than in Britain. In New South Wales, as elsewhere in Australia, the right-wing faction was victorious. The dynamo of the NSW Right has been the party machine, in alliance with some of the trade unions. The parliamentary party and the government became its playthings: premiers were made and unmade by it. The point of politics became not policy but politics, and most of its practitioners were men and women who had done nothing else since university, if not before. (Here the comparison with Britain becomes very close.) Since all that mattered was winning elections, the role of the machine was to monitor every movement, however slight, of public opinion. It took one bad opinion poll for the NSW Right to remove Kevin Rudd.

NSW government was focus-group politics par excellence. In order to win elections you had to have money, and raising money was the obsessive concern of the machine. That is how the Labor Party became the party of the property developer, which divorced it from much of its traditional electorate and undermined its once strong ethnic minority vote – ever more important in Australian politics. It also divorced the party from the Greens. As its primary vote has fallen, Labor has relied increasingly on the second preferences of Green voters (Australia has AV). It had generally assumed that ‘progressive’ middle-class voters, which it rather despises anyway, had nowhere else to go and treated them accordingly. As result, at this election Green voters declined to ‘preference’ Labor in a number of crucial seats. Labor lost them. This has, unsurprisingly, demoralised the parliamentary party, a number of whom, ministers and backbenchers, left politics suddenly in more or less scandalous circumstances.

The monument to the NSW Right is the wreckage of the Labor Party in its historic base: Sydney’s sprawling western suburbs and the industrial constituencies to the north and south of the city. But the NSW Right is still at it. The new leader of the state parliamentary party was elected by his little band unopposed, having been chosen before the election was lost and before the Labor premier had resigned. It is still unclear what effect this will have on the federal party. Victory in NSW (which it surprisingly achieved in the federal elections last November) is essential for it and this is not a good omen.

There is a lesson for all social democrats here, as there is from the fate of the British Labour Party. Caution, timidity, worship of the focus group can get you some of the way; but when the end comes, it comes very badly.