The aim of Operation Moshtarak in February was to capture the city of Marjah in Afghanistan's war-torn Helmand province. Fifteen thousand troops, mainly American, British and Afghan, were to take on between 400 and 1,000 Taliban insurgents holed up in a city of 80,000 people.

Commanders talked of a "new model war". An Afghan administration and police force would move into Marjah behind the soldiers. Engineers would maintain power and water supplies. "We've got a government in a box, ready to roll in," said the then-US General Stanley McChrystal.

But as the offensive unfolded, reported Taliban casualties were few, and Marjah turned out not to exist. Faithfully reported by global news media, it was in fact invented by US military officials. "This is all a war of perceptions," McChrystal said. As The Washington Post reported, the decision to launch the offensive was intended to influence US public opinion on the effectiveness of military action in Afghanistan by showing it could win a "large and loud victory". In reality, Marjah is a vaguely-defined area of villages, markets and family compounds. If there are tens of thousands of people, they are spread across 125 sq miles. Marjah was invented because a military operation has to have a clear-cut goal to be deemed a victory. President Obama had doubled the total US troop deployment, but public support was waning. The generals needed a victory, so they created Marjah and planned Operation Moshtarak to capture it.

A phantom city was needed because the enemy is a phantom. A task force is assembled and motors into bandit country. If it is too small, it risks annihilation. If it is too big, it finds itself punching the air. A golden rule of guerrilla warfare is that you fight only if you are certain to win. So the invaders of Afghanistan are waging a war against an enemy who is never there.

"Suppose we were (as we might be)," wrote T E Lawrence, "an influence, an idea, a thing intangible, invulnerable, without front or back, drifting about like a gas? Armies were like plants, immobile, firm-rooted, nourished through long stems to the head. We might be a vapour, blowing where we listed... Ours should be a war of detachment. We were to contain the enemy by the silent threat of a vast, unknown desert ..."

Lawrence was a young officer who had spent the first two years of the First World War in the intelligence department in Cairo. On a diplomatic mission to the Hijaz region of western-central Arabia in 1916, he had formed a personal relationship with Prince Faisal, a commander now ranged in revolt against Ottoman rule. Faisal asked that Lawrence be attached to his service as a British liaison officer. Lawrence's superiors agreed. The Ottoman Empire, though much reduced, still controlled a vast territory from south-eastern Europe to the Caucasus, the Tigris, the Yemen, and the Suez Canal. Plunging into the world war, this ramshackle traditional empire, though fighting a war on four fronts, against the Russians in the Caucasus and the British in Gallipoli, Sinai, and Mesopotamia, proved a tougher opponent than its enemies predicted.

The Arab Revolt, led by the Emir of Mecca, had been encouraged by secret British diplomacy as a source of military and ideological support for the Allied cause. But after momentary success – principally the capture of Mecca itself, along with the Red Sea ports of Jidda and Rabegh – the Revolt stalled. Medina remained in Ottoman hands, and the city's 10,000-strong garrison was receiving reinforcement. When the Turks went on to the offensive, the Arabs fell back, and the tribal irregulars forming the army began to melt away. In late 1916, the Revolt hung by a thread.

Lawrence, newly arrived in the Hijaz, was witness to this looming disaster. His response appears to have been a radical re-conceptualisation of the war. He turned conventional military thinking on its head and created a new theory of modern guerrilla warfare. What if the Arabs ignored the Turks? What if they simply marched away from them into the desert? What if they constituted themselves as a "silent threat" and waged a "war of detachment"?

This they did. In fact, even before Lawrence had worked it out, they had made a start by marching 200 miles north – away from the Turks threatening them around Medina – and establishing a new base at Wejh. Supplied here from the Red Sea by the Royal Navy, they then staged a series of raids on the Hijaz Railway. Running through 1,000km of desert, a lifeline on which the Ottoman grip on Arabia depended, the Turks had to defend it. But against an enemy who could appear suddenly out of the desert haze at any point to defend the line at all was to defend all of it. So instead of a concentration of force at the decisive point – at Medina, from which a thrust towards Mecca might have snuffed out the rebellion – the Turks were forced to plant 100, 200 or 300 men every few kilometres.

Then, in June 1917, Faisal's Northern Army, inspired by its brilliant British military adviser, leapt forwards again, some 250 miles to Aqaba. But they did not go direct: following a 500-mile route through the desert, a small commando group appeared north-east of Aqaba, raised the local tribes in revolt, and rolled up the Ottoman positions all the way to the coast.

With a new forward base, the insurgency could be supplied as it spread into Syria. British intelligence reports from 1918 reveal its success. The Arab armies comprised about 5,000 regulars and a fluctuating force of up to 20,000 tribal irregulars. Yet more Turks were deployed against them than there were fighting General Allenby's army of 340,000 men west of the Jordan in Palestine.

In fact, given that most of the serious fighting was done by Faisal's Northern Army, which was never more than 8,000-strong, often as low as 3,000, the imbalance was extreme. The raw statistics imply that one of Faisal's guerrillas was 35 times more effective in tying down Turkish troops than one of Allenby's Tommies.

Lawrence's ideas on guerrilla warfare were touched upon in his "Twenty-seven Articles", which appeared in an internal British intelligence bulletin in 1917. They were then developed in three post-war treatises. Reading closely, one can identify 15 distinct principles of guerrilla warfare (see box). They are extraordinary. They invert many principles of conventional military theory, such as concentration of force, and the centrality of pitched battle to destroy the enemy's main forces and will to fight. In this sense, they are the work of a brilliant maverick – an unconventional intellectual who had not even undergone the military training given to volunteer wartime officers (though he probably learnt something as a member of the Oxford University Officers' Training Corps).

They draw on the traditional tactics of the "eastern way of war" – as embodied in Bedouin tribal raiding – yet elevate this into a strategy for what would later be called a "national liberation struggle". The Arab leaders' emphasis was on creating a regular army, not on guerrilla warfare. Again, just as Lawrence was not hidebound by British military tradition, nor was he constrained by Arab political ambition.

The third striking thing about the 15 principles is how seminal they are. Guerrilla warfare is as old as human conflict, but Lawrence's treatises represent the first systematic conceptualisation of its strategy. And this conceptualisation is remarkably comprehensive. Later theorists of guerrilla warfare – notably Mao, Nguyen Giap and Che Guevara – have added little of substance. Lawrence is the real teacher of the guerrilla fighter.

The fourth remarkable thing is lack of recognition for the intellectual achievement. Despite the central significance of guerrilla warfare in the last century of world history, Lawrence has rarely been acknowledged. Robert Taber's 1965 book, The War of the Flea: A Study of Guerrilla Warfare, Theory and Practice, has no mention of Lawrence nor the Arab Revolt. Only recently has awareness grown – notably among US Army officers – of Lawrence's significance as a military theorist.

The exigencies of imperial wars in Iraq and Afghanistan have made the study of guerrilla warfare a necessity, and officers have been encouraged to read Lawrence's 1922 treatise Seven Pillars of Wisdom. Leading counterinsurgency specialist Lieutenant-Colonel John Nagl echoed Lawrence in the title of a recent book Counterinsurgency Lessons from Malaya and Vietnam: Learning to Eat Soup with a Knife (2002). His point – "to make war upon rebellion is messy and slow, like eating soup with a knife" – encapsulates the challenge of foreign invaders fighting guerrillas.

But Seven Pillars of Wisdom, however carefully read by US officers, is likely to be the book of their defeat in Afghanistan. The counterinsurgent regular cannot replicate the tactics of the insurgent guerrilla. The former is an invader. The guerrilla is embedded in local society. This basic dichotomy manifests itself in a dozen practical, and potentially deadly, ways. The regular is imposed on the military landscape and is dependent on heavy equipment, modern communications, and external supply. Intelligence depends on observation posts, patrols, and interrogation, and security entails the full panoply of fortified posts, armoured vehicles, and firepower. The invaders are therefore highly visible, relatively immobile, and poorly informed.

Compare the guerrilla. He is largely self-sufficient, highly mobile, with superb intelligence from his social network, and indistinguishable from the civilian population of which he is part. He is almost invisible, yet has the capacity to strike anywhere, anytime. The regular strives to dominate landscape by visible threat and heavy firepower. But wherever he is, the guerrilla is not.

The guerrilla dominates the landscape, for his embeddedness makes him an invisible, secure, and ineradicable presence. He is powerful because he is a phantom. Let the last word go to Lawrence. He could be describing Operation Moshtarak – 15,000 men chasing phantoms out of a non-existent city in Afghanistan. But, of course, it is the Arab Revolt of 1916-1918. "It [the rebellion] had a sophisticated alien enemy, disposed as an army of occupation in an area greater than could be dominated effectively from fortified posts... The active rebels had the virtues of secrecy and self-control, and the qualities of speed, endurance, and independence of arteries of supply... The presence of the enemy was secondary. Final victory seemed certain, if the war lasted long enough for us to work it out."

Dr Neil Faulkner is editor of the new 'Military Times' magazine (out now), and co-director of the Great Arab Revolt Project. For details, visit Military-times.co.uk

Military mastermind: Lawrence of Arabia's 15 principles of modern guerrilla warfare

1. Strive above all to win hearts and minds

2. Establish an unassailable base

3. Remain strategically dispersed

4. Make maximum use of mobility

5. Operate mainly in small, local groups

6. Remain largely detached from the enemy

7. Do not attempt to hold ground

8. Operate in depth rather than en face (i.e. not in lines)

9. Aim for perfect intelligence about the enemy

10. Concentrate only for momentary tactical superiority

11. Strike only when the enemy can be taken by surprise

12. Never engage in sustained combat

13. Always have lines of retreat open

14. Make war on matériel rather than on men