THE spontaneous cheers of the Grangemouth workers on Friday at the news of their capitulation said it all.

This has been one of the worst industrial relations disasters of modern times and has disturbing implications for trade unionism, the Labour Party and Scotland. The workforce only narrowly escaped with their jobs, but had to accept all of Ineos's terms - a promise not to strike, a three-year wage freeze, zero bonuses, the end of final salary pensions. It was game, set and match to private equity.

The result will have been noted by every industrial employer in Britain, as the highest-paid and best-organised (in a trade union sense) industrial workers in Scotland have been humbled. Indeed, at times Grangemouth felt like a speed-dating version of the miners' strike in 1984 as workers were on the point of destroying their own livelihoods. Had it not been for the efforts of the hyper-active First Minister, and the fact that the workers effectively sacked their own union leaders, we would have been lamenting another Ravenscraig this weekend.

Indeed, Grangemouth's obituary had already been written in newspaper offices across the country: how the fall-out would devastate the Central Belt just as the crash of Ravenscraig obliterated the economy of Motherwell. Reporters had sought out local businesses preparing for relocation or closure, spoken to workers checking the job centre more in hope than expectation, and to mothers worried about feeding their children. It's an easy story to write. We've written it 100 times: industrial vandalism; the unacceptable face of capitalism; workers sacrificed on the alter of profit…

I've written unflattering things myself about the way in which Ineos owner Jim Ratcliffe does business. Ineos is a private equity company that specialises in deals below the radar and fancy (albeit legal) accountancy. Its claims about losing £10 million a month at Grangemouth seemed exaggerated to say the least. But in this particular case, the unions played into Ratcliffe's hands, and proletarian romanticism should not prevent us from stating what actually happened here.

Last weekend, Unite seemed prepared to allow one of Scotland's most important industrial centres - along with the livelihoods of 800 workers, and 2,000 contract employees - to be sacrificed to their own obstinacy and self-interest. Their beef with Ratcliffe began with a row over union official Stephen Deans's involvement in the selection of a Labour candidate in the Falkirk by-election. The union threatened strike action in defence of their official, who was suspended pending an investigation.

No-one should be in any doubt that Ratcliffe was exploiting this situation. But while posturing and blustering about Deans, Unite failed to realise that Ratcliffe was serious about closing the Grangemouth petrochemical plant. If any of Unite's officials had lifted a phone to call one of Scotland's legion of oil analysts, or any business journalist, they would have been told that Grangemouth is on a distinctly shoogly peg; that its out-dated plant and history of poor industrial relations made it a likely candidate for the chop in a global business hit by falling prices and competition from low-cost countries in Asia.

Too many Labour politicians, shaking righteous fists at Ratcliffe, ignored the contemporary industrial reality: people like him don't care what anyone says about them. Nor was he bothered by the prospect of a work-in. In a petrochemical plant with an international supply chain? Go right ahead, gentlemen…

Had Grangemouth gone under, songs of woe would have been sung on the picket lines and at benefit concerts, and journalists like me would be calling for the curbing of capitalist greed. But that wouldn't have been much use to the workers looking for new jobs.

For the union to lead its workers to the cliff without realising this beggars belief. But then allowing them to walk over it, with no safety net waiting below, is a tactic that makes no sense. In any other organisation, heads would be rolling. Yet on Friday, Unite leaders were congratulating themselves on saving the Grangemouth petrochemical plant. Talk about self-delusion. This was like arsonists congratulating themselves for being saved by the fire brigade.

The firefighter in question, was of course, Alex Salmond. The First Minister, as anyone who knows him will testify, loves a good crisis and the attention it brings. But he is also a pretty useful person to have around in one. I have heard nothing but praise from all sides (bar Unite) for the way Salmond handled the dispute.

Politicians don't decide the fate of industrial plants - owners do. In the age of global capitalism, politicians are pretty much left on the sidelines to clear up the mess left after the profit motive has done its work. The Scottish government realised before Unite that Ratcliffe was serious about closing Grangemouth - well, they do read the Financial Times. So Salmond and finance secretary John Swinney had to perform a difficult double: they had to persuade one of the world's most headstrong capitalists that he was about to lose money, at the same time as elbowing aside one of Britain's most powerful trade unions.

Salmond insisted to Ratcliffe that the government had laid "contingency plans" long since for an alternative buyer for Grangemouth. Swinney then dumped a heap of numbers on Ineos to persuade it that, with £9m from the Scottish Government and a guarantee from the UK government worth about £130m, it would be the laughing stock of the City if it passed.

I don't know if there really was another buyer. There were suggestions that temporary public ownership might have been an option, perhaps in collaboration with the Chinese, who already own half of Grangemouth. But Ratcliffe seems to have bought at least part of it.

At the same time, Salmond was on the line to Unite general secretary Len McClusky trying to persuade him that industrial madness had afflicted his Grangemouth office and that he had better have a word with them. The consequences might not only be a collapse of union membership - that's happening anyway - but serious damage to the Labour Party in Scotland. Johann Lamont is a Unite member and the union backed her leadership campaign in 2011.

Some Labour people might have been content to see the plant close, the better to damage Salmond, but the people of Scotland were looking for a solution, not another 1980s industrial horror show. This alerted Labour leader Ed Miliband, who has of course been in dispute with Unite over the Falkirk selection fiasco.

There were also direct appeals to the Grangemouth workers who had been divided on the action, about half having voted against it. By Wednesday night, confident of the workers' agreement, Salmond had persuaded Ratcliffe and brokered a deal which involved Ineos reopening the plant, investing £300m (most of which was effectively underwritten by the government) to provide a 20-year future for Grangemouth as a global player turning shale gas from America into plastics.

The price, in terms of changes to pay and conditions, was high: these were very tough terms. But if you play poker with someone who holds all the aces, the only sensible action is to fold.

Could they have got a better deal? Probably, if the situation had been handled intelligently earlier. The wage and bonus freeze was of secondary importance since wages only account for about 1.5% of Grangemouth's costs. But there was no way Ratcliffe was going to invest in new plant if there was any risk of a repetition of the 2008 strikes. And the final salary pensions had to go, as they have gone in almost every other FTSE 100 company. In other words, the employees could probably have kept their pay bargaining and their jobs.

Where stands Scotland? Grangemouth is key to the North Sea's biggest oil field - the BP-operated Forties field 110 miles east of Aberdeen. Up to one-third of the North Sea's entire crude oil production is fed directly into the Grangemouth site. During the strike in Grangemouth in 2008, 70 North Sea platforms were forced to shut down or reduce production. It is hardly surprising therefore that BP - former owner of Grangemouth - was heavily involved in this week's rescue and helped underwrite the new business plan.

It is perhaps ironic that it is the shale gas revolution that has indirectly helped save Grangemouth, since it has caused a collapse in raw energy prices. But if the promises of a 25-year lifespan are honoured by Ineos, Salmond will still be able to claim Scotland remains a country that not only produces oil and gas but also processes it into plastics and petroleum. This will underpin the Scottish Government's plans to promote industrial diversification. But the greatest relief will be felt among the small businesses of Falkirk and surrounding areas who feared as recently as last Thursday that they were about to become an economic wasteland.

If Grangemouth petrochemicals had gone south, literally and metaphorically, Scotland's future as an energy economy would have been jeopardised. The refinery itself would have become a lame duck, as suppliers and customers of Grangemouth began to look elsewhere. Moreover, it was clear from the near invisibility of Grangemouth in the UK media this week - no mention at Prime Minister's Question Time or on the BBC's Question Time - that this issue barely figured on the UK political radar. So, 800 jobs to go at an obsolete plant after a union cock-up. What's new?

It wasn't Ravenscraig revisited. The difference this time is that there was someone in Scotland with the will and the authority to turn things around. Even if he had wanted to, David Cameron could never have devoted the time and effort and personal prestige to Grangemouth that Salmond invested. The SNP government may be accused by some on the left of being the tool of Ratcliffe, complicit in the destruction of the workers' pay and conditions. But when the alternative was the dole queues, I think the Scottish public will be satisfied that this was the best outcome.

The impact on the independence debate? It may be that a few votes went astray in Dunfermline on Thursday night as the SNP suffered its worst by-election defeat since Glenrothes in 2008. But then the wife-beating former MSP Bill Walker's reluctance to do the decent thing lost a lot more.

I don't believe Grangemouth will be in voters' minds in September as they decide whether Scotland should be an independent country. Would Scotland be in any better position to negotiate the shark-infested waters of international capitalism alone or with the UK? I'm not sure I can answer that question. However, I am pretty sure that, whatever the constitutional destiny, Scots will be happy to see Alex Salmond hang around as long as he has the form he showed last week.