Apart from it being the birthplace of Irn-Bru, the first thing that will pop into most people's minds when they think of Falkirk is the schiltron, or sheltron, the use of which was first recorded at the battle there on July 22, 1298.

It had probably been around for some time before that and may have been used at Stirling Bridge, but, as is the case with so many other things, it only really got attention when its deficiencies became apparent.

The schiltron was a defensive structure, made up of pikemen arranged in formation (at Falkirk, four circular, hedgehog-like blocks, dug in with stakes around them) used to good effect throughout the First War of Scottish Independence. But it didn't work very well at Falkirk.

Historians differ - as they tend to - on the main reason why. It may be that the Scottish knights rode off at the wrong moment, or failed to attack at the right one, but the usual explanation is that the use of the longbow, a relatively recent addition to the armoury, by Edward I's army was the decisive factor.

The lesson is that if you open up a hole in your opponents' defences with a few well-aimed barbs, you can then create enough divisions to start attacking properly. If their leaders run off while the footsoldiers are in disarray, you can soon rout them.

I am fairly confident that this will be the first parallel ever drawn between Ed Miliband and Sir William Wallace, but the Labour leader might give this lesson a bit of thought. The party's handling of the selection of their candidate for Falkirk has been an unqualified catastrophe. What's more - a regular factor in Labour's foul-ups - almost everybody appears to be in the wrong, while they all claim that they've been vindicated. Even if, by some accident, there's anyone who is in the right, you can be sure he or she has been thoroughly compromised by the shambolic way the whole thing's been dealt with.

Mr Miliband's first mistake was to rise to the bait. Wallace's technique had chiefly been to deny English army access to materiel and provisions (in a sort of scorched earth approach) and wait for them to get tired and squabble amongst themselves, and only then harry them. He had been trying to do this at Falkirk, but was forced to stand and fight, which was where his error lay.

That's also what opposition should be about. Instead of dodging a direct challenge, and snapping around David Cameron's heels, Mr Miliband decided to stand his ground when it was alleged that Unite had been attempting unfairly to influence the selection of the candidate in Falkirk.

He launched an inquiry. He suspended the candidate and local chairman. He made it known that he would be revising the Labour Party's links with trades unions, and changing the way in which they funded the party.

All this demonstrated was that the Prime Minister's arrows hit home. The Tories have long believed that Labour's dependence on the trades union movement for its funding is a chink in their armour, and decided to target it. They've got a point, too. Schemes like the Union Modernisation Fund and the Union Learning Fund handed large chunks of taxpayers' money to trades unions, who then handed large chunks of money to Labour.

Between 1998 and 2010, the Government gave Unite (and the two unions which merged to form it in 2007) around £18 million, and, over the same period, it gave the Labour Party about £30m. The Taxpayers' Alliance has estimated that, if you include pay for public employees doing union work, the union movement received at least £113m of public money last year.

But, while you might expect me to congratulate Mr Miliband for finally doing something about this ridiculous, and downright fishy, state of affairs, from his point of view his actions have been idiotic. A leader should reorganise his own supply lines, determine his strategies and discipline the ranks on his own initiative and to his own timetable. To do it on the prompting of your enemy is to play straight into his hands. In case it hasn't occurred to him, may I just point out: Ed, David Cameron doesn't have your best interests at heart.

After Dave took this shot, and Ed reacted as he did, what's the outcome? Labour's "internal inquiry" concludes there was no wrongdoing, but only because "key evidence" was withdrawn. Karie Murphy, the Unite-backed candidate, has her suspension lifted (as does the local chairman), but she stands down as candidate for the seat. Len McClusky of Unite says the union's been vindicated. The Labour MP Tom Watson calls for an apology. Mr Miliband refuses to give it. The other parties, and the media, demand publication of the details of the inquiry, which are not forthcoming. Unions cancel direct debits which go into the Labour Party's bank account. Mr Miliband (approval rating previously about -56) achieves the impossible, and goes down in the public's estimation. The PM opens the champagne.

In other words, a total rout.

And all avoidable if Mr Miliband had chosen not to engage. The fact is that, though Labour's relationship with, and financial dependence on, trades unions is unhealthy - does, indeed, stink - there are several good historical and practical reasons why the party finds itself in this position. But from the Labour leader's perspective, none of them ought to matter urgently, because this kind of issue is the obsession and interest of politicians and journalists.

Reform of Labour Party funding may be right, may be morally essential, may be in the long run politically advantageous. None of that matters, because right now, it's not at the top of any voter's list of priorities. What ought to matter to Mr Miliband is winning the next election, and what this mess demonstrates is that he isn't up to the job.

This doesn't look like a show of leadership that might yield political benefits, like Neil Kinnock taking on Militant, or Tony Blair sweeping away Clause 4. It looks like an incompetent commander letting the enemy dictate the terms and terrain of the battle, being forced to fight on two fronts, losing the confidence of his allies, cutting off his own supply lines, before running off into the woods desperately trying to save his own skin and leaving most of his supporters bloodied and defeated.

Of course, I'm quite pleased about all of that. But if he, or other members of the Labour Party, continue looking at the historical parallel, they'll see what happened next in that war. Wallace resigned, but the cause eventually won, under a different leader.