Blink and you'd miss them, but somewhere amongst the blood and cordite in Iraq there are 2,000 Australian troops. The numbers seem insignificant next to the American behemoth. It would take five baseball stadiums to contain the American force in the Gulf: the Australians could fit comfortably in the concert hall of the Sydney Opera House.

Whatever faith you may have in the competence of Australian troops, they can't be playing any role which the US and British forces couldn't perform without them. So what on earth are they doing there? The question has been on the lips, not just of protestors, but of mainstream politicians. During the soldiers' send-off on Sydney harbour in January, opposition leader Simon Crean told them bluntly that they should not be going to war. He maintained the position till Thursday, when he switched track because of that nebulous need to maintain "morale" - a u-turn which has thrown elements of his party into open revolt. (By the way, the idea that the morale of Australian troops risking life and limb is going to be affected by what Simon Crean says is absurd: Mr Crean's u-turn has nothing to do with Australian troops, and everything to do with him covering his back against the inevitable khaki upsurge in domestic support for the war.)

None of the obvious explanations for an Australian presence make sense. If the threat from Iraq to the US and Britain is slight, it is even slighter in the case of Australia. Canberra has no strategic interest in the Middle East, and the only direct economic effect of the war so far has been the cancellation of Iraq's £300m annual contract to buy a fifth of Australia's wheat exports.

Unlike North Korea, whose rumoured Taepo Dong 2 missile could carry a nuclear payload into the heart of every Australian city, Iraq lies too far from Australia to ever pose a threat to the country - even in the unlikely circumstances that it would want to.

Then there is the argument that a display of solidarity buys influence in Washington, and an opportunity to moderate the White House's policy. This looks pathetically threadbare when trotted out by British governments; when it comes from Canberra, it is little short of laughable.

So what is Canberra doing sending 2,000 troops into what is turning out to be a vicious and dangerous combat zone?

Part of the explanation can be found with a look at Australian history. Since federation in 1901, Australia has always contracted its defence policy out to a foreign superpower, and fought in that country's wars as a downpayment. According to veteran political journalist Max Walsh, Australia's 1960s deputy prime minister Jack McEwen frankly described the country's involvement in Vietnam as a premium to be paid on an essential insurance policy.

This has created strange contradictions in terms of Australia's national independence. As parades marked the birth of a new nation in 1901, Australian troops were fighting British colonial wars in South Africa and China. Later, Anzacs would voluntarily put themselves in the firing line for Britain in both world wars.

Only at the end of 1941, when it became clear that Churchill was more concerned with preserving India and the Middle East than helping Australia, did Canberra decide to switch its policy providers. In future, America would be the insurer of last resort, and since 1942 Australia has been Washington's staunchest ally: the only country to have joined America in both Gulf wars, Korea and Vietnam.

At first glance, there seems to be sense in this. Australia is a vast continent with a small population, whose natural hazards would pose as much of a problem to a defender as they would to an invader.

Former defence minister and Labor party leader Kim Beazley once plucked a figure from the air and claimed that Australia's benefits from the alliance with America would be equivalent to increasing defence spending by 1 per cent of GDP - around £3bn a year, at current prices.

It's only when you start asking yourself who is threatening Australia that the problems start. New Zealand? Not likely. Papua New Guinea? Pull the other one. Japan, China, North Korea? Too far away. The answer, as any Australian will know instantly, is Indonesia.

To the outsider, this belief might seem strange. Jakarta and Canberra can be frosty in their relations with each other, but since the 1960s they have maintained a close relationship. Neither has anything to gain from threatening the other.

Any invasion of Australia by Indonesia would have to either settle for the economically backward, weather-ravaged settlements of the far north-west or involve itself in an almost suicidal push across the central deserts to the economic centres of the south-east.

But the idea of invasion touches a visceral note of fear in a country which has never suffered an attack by ground troops. Australia's self-image is intensely bound up with its geography: the outline map of the continent fulfils much the same role in Australian iconography as does the stars and stripes in America.

The country's most chilling and persistent wartime myth is that of the "Brisbane line", the rumour that prime minister Robert Menzies planned to pull back to a rump statelet in the south-east corner in the event of Japanese invasion in the second world war.

Those potent if improbable fears remain strong even today. When a single Philippines security chief claimed last year that the Indonesian-based fundamentalist group Jemaah Islamiya had plans to conquer Australia's tropical north, the suggestion attracted blanket coverage for days in the national media. This is despite the fact that JI's political objectives are based solely around extending Islamist government to existing or former "Muslim lands" - and however you frame it, the overwhelmingly European, Aboriginal and east Asian population of northern Australia doesn't fit into that mould.

The point about these stories is that they betray a deep insecurity within Australia regarding its position in the world. Even the most apparently sensible and level-headed Aussies will give credence to the possibility of an Indonesian invasion. According to one report at the weekend, the prime minister, John Howard, regularly lies awake at night worrying about the possibility of an Islamist takeover in Indonesia, and the consequent territorial threat.

Such fretting is not just the preserve of the xenophobic political right, either. The Australian and international left embraced former prime minister Paul Keating's policy of engagement with south-east Asia because it evoked images of a bold multiculturalism and an abandonment of racist "white Australia" values. But it is important to realise that alongside the idealism there was always a more Machiavellian purpose, to neutralise the perceived threat from the region by keeping the old enemy closer than ever.

After more than a century in which the only serious military threats to the country have been a couple of Japanese bombing raids in the far north-west during 1942-3 (the famed Japanese submarine invasion of Sydney harbour did less damage than the average New Year fireworks display), it really is time that Australian governments started asking whether this insurance policy is worth it.

After all, it is strange that this country, whose greatest foreign policy reversal came about when Australia was betrayed by Winston Churchill's realpolitik, should have such faith in the loyalty of an increasingly unilateralist America.

In the unlikely event that Australia did find itself threatened by an aggressive local power, America's decision whether to help it or not would be likely to depend more heavily on a hard-headed calculation of political advantage, rather than payback for those 2,000 Anzacs in Iraq.