THE annual dinner of SNP MSPs on Wednesday was supposed to be a double celebration.

Held at the Radical Road pub in Edinburgh, it was intended to mark not only the first anniversary of the party's Holyrood landslide, but also its follow-up victory in the council elections.

But even as Alex Salmond tried to lift spirits by reminding the room his party had won the most seats and taken the biggest slice of the vote – something only Labour could deem an SNP failure – there was a subdued undertone to the evening.

Big prizes such as Glasgow, Aberdeen and Edinburgh had eluded the SNP, dashing hopes and taking the shine off progress elsewhere.

Worse, news was arriving that even in councils where the SNP had won the most seats, the other parties were freezing them out of power by forming so-called "Unionist alliances".

There had been similar pacts before, notably in Perth & Kinross, where every man and his dog had once lined up to keep the SNP at bay, but this time the numbers were mushrooming. Despite the obvious differences, Labour and the Tories were striking deals in Aberdeen, Stirling and East Lothian.

Only in the capital, where Labour and the SNP had buried the hatchet and admitted their left-of-centre similarities, had the two most obvious partners come together.

And more Labour-Tory matches have blossomed in East Dunbartonshire, Falkirk, South Ayrshire and West Lothian.

So could this be a new era of coalition politics for Scotland, in which the SNP and Labour can set aside their differences for the common good?

Or one in which Salmond's party is marginalised as part of a "take no prisoners" approach by their rivals before the independence referendum?

The truth, it turns out, is more complex. Rather than being victims of Unionist cabals, the SNP are actually victims of their own success.

And despite the statistics being on the SNP's side, it is Labour who are reaping the rewards. First, it is worth noting that since the proportional single transferable vote system (STV) was introduced for Scottish local elections in 2007, coalitions have been the norm, running more than half of our 32 local authorities.

At Holyrood, there is a tradition that the largest party is given the first chance to form an administration, if it can find willing partners.

This happened in 1999 and 2003 between Labour and the LibDems, and in 2007 the SNP expected to strike a deal as well, only to be forced into running a minority government after the LibDems baulked at an independence referendum.

But there are no such niceties in local government, where arithmetic is king. Almost every flavour – including Labour and the Tories sharing power, and the SNP and Tories in cahoots – has already been tried.

Most endure, unless by-elections or defections have changed the underlying maths, as happened in Dundee in 2009 when a by-election saw the Labour-led coalition flip to an SNP minority. So the current horse-trading isn't new, and even the unlikely alliances that emerge should last.

But something definitely has changed. Although the SNP won the most votes and seats, it is likely to end up running fewer councils, as Labour-Tory deals come to the fore.

Given the Tories are desperate to prove they still exist in Scotland, it is no surprise they have been grabbing power wherever they can.

It is Labour's actions that seem to be more puzzling – and cynical. The explanation, claim the SNP, is that Unionist stitch-ups are denying them power, partly to rob the independence cause of momentum.

In Stirling, where an SNP minority was replaced by a Labour-Tory coalition, the SNP called the outcome a "betrayal" of voters' wishes, as the Nationalists were the largest party. The SNP's Graham Houston, who had been council leader, declared himself "amazed", accusing Labour of wanting power "at all costs". But the SNP had also tried to strike a deal with the Tories, offering them the deputy leader's position provided the SNP got leader and provost. When the Tories refused, the SNP offered the same package to Labour, and were rejected twice over.

Houston only cried foul after Labour and the Tories snubbed him and joined forces instead.

And in Highland and the Borders, the SNP happily played hardball to carve out the largest groups – the independents and Tories respectively – by allying with other parties.

CORRIE McChord, Stirling's new Labour leader, said the SNP were "hypocritical" as they had only been able to rule with tacit Tory support, and were out because they treated others with "arrogance".

But he also said the independence referendum was a factor: both Labour and the Tories felt the SNP had poured a disproportionate amount of money into Bannockburn because of its status as an SNP icon.

"We want to give Bannockburn its fair due, but we don't want it to be an icon of separation. The Tories have felt that for some time as well.

"The social polices of the SNP and Labour are much more aligned than the social policies of Labour and Tory. But the relationships are just not there to work together."

John Curtice, professor of politics at Strathclyde University, said the national political picture, including the referendum, and the habit of parties to gang up on whoever last ran the council, would be factors in coalition-making.

But far more important was the dire state of the LibDems, who lost almost 60% of their councillors in a backlash against the UK Coalition.

Before May 3, the LibDems and SNP had been each other's staunchest allies in local government, co-operating in seven of the 13 councils each party helped run, including Aberdeen, Edinburgh, Fife, Perth & Kinross and Renfrewshire.

But with the SNP and Labour gaining seats at the LibDems' expense, the Nationalists had been left struggling to find new coalition partners.

The result has been a flourishing of previously impossible deals between Labour and the Tories.

"The SNP had more alliances with the LibDems than anyone else before May, and one of the reasons they're finding it difficult to get control of administrations is that crutch is no longer available," said Curtice.

A senior SNP source admitted a lot of the party's complaints since the election were a smokescreen to cover the embarrassment of being unable to form alliances.

"In a few places there were attempted deals with the Tories," the source said. "The idea was to get into power by any means possible. There's sour grapes coming out because Labour and Tories managed the deals that we couldn't, so there's this Unionist alliance stuff. But it's a smokescreen by SNP groups for failing to strike deals themselves."

Attention now moves on to who calls the shots at the local authority umbrella body, Cosla. It seems Labour wants to use Cosla as a megaphone to denounce Salmond's budgets, and no doubt warn of worse under independence.

Stephen McCabe, Labour leader of Inverclyde and tipped as a future Cosla president, told the Sunday Herald it was time to rebalance the relationship between local and central government: "We may be able to stand up to the Scottish Government a wee bit more. It's shaping up to be a different Cosla."

On paper, the SNP won the local elections hands down, but in practice they face another bruising fight with Labour when they least need it, on the road to the referendum.