How did Ewoks beat stormtroopers? How did a legion of the Emperor's "best troops" get so profoundly whupped by a tribe of savage but cute two-foot-tall teddy-bears?
This is seen by many people as the key problem with RotJ. The Ewoks would, perhaps, be fine if it wasn't for the fact that, armed only with spears and primitive torsion artillery, they won a major ground battle against a large force of the Empire's finest blaster-wielding commandos backed up by at least one troop of armour.
But, after years of sleepless nights, I believe I have come up with a truly persuasive retconn that explains it all away.
Every other time we see stormtroopers in action in the films, they are taking part in close-quarters combat in confined spaces, or engaged in low-profile patrol work. I suggest therefore that their primary role is as shock-troops, and their secondary role is as 'naval infantry' or 'military police'.
None of this prepares them for fighting in a forest, and - I will argue - they were not expecting to fight in a forest in RotJ.
PRIMARY ROLE: SHOCK TROOPS
We see stormtroopers act as shock troops three times in the movies. These three engagements cover all their large-scale deployments before RotJ, and all three instances, they are operating in confined areas, fighting close-quarters combat.
Such operations, I suggest, are what stormtroopers are trained for: sudden shock strikes in the sorts of places the Empire would most expect to find Rebels - enemy ships or hidden bases, or, if their own security is breached, Imperial installations.
When the Empire faces an entrenched enemy or engages in a full-scale battle, an armoured (walker) force is used instead of infantry.
(I assume that "snowtroopers" are simply "stormtroopers" in cold-weather combat gear; how likely is it that even the Executor would have regiments of specially-trained soldiers aboard?)
SECONDARY ROLE: NAVAL INFANTRY/MILITARY POLICE
Stormtroopers can also serve as armed landing-parties, the equivalent of real-world marines (in the non-US sense of 'naval infantry'). They give Imperial ships the ability to investigate and police low-intensity incidents planetside. We see them in this role twice.
It is also possible that local detachments serve as a sort of colonial 'military police' - a role which segues in somewhat with the garrison functions outlined above.
(It is increasingly unclear whether any of the stormies seen on ANH could have come from a local garrison: Tatooine is apparently a Hutt fief in TPM, RotJ, and the lates NJO novel, "Jedi Eclipse". Do ISDs carry dewbacks?-)
So: why was a legion of stormtroopers sent down to the forest moon to face the Rebels?
The answer, I propose, is very simple: they were expecting to engage the Rebels within the bunker itself.
Had the Rebels, rather than deciding just to blow up the first thing they found that looked important, behaved like professional soldiers and siezed the main control area of the bunker (presumably located near the landing-pad and shield generator), then a legion of stormtroopers would have been the obvious force to deploy to overwhelm and defeat them quickly.
Although the Imperial strategists miscalculated by assuming that the Rebels would behave like trained soldiers, Han's failure to post an effective guard allowed the Imperials to easily capture the entire commando team alive.
That should have been it. They had won the battle almost without firing a shot. Bringing the Rebels out into the open was intended to remove them from the expected field of combat; but instead, it left the stormtroopers vulnerable to the Ewok ambush.
Trained to fight at close quarters, in confined spaces, the stormtroopers were caught off-guard. Their white armour, excellent for the smoke-filled metal- or duracrete-walled corridors of starships and bases under attack, was useless in the forest.
Unlike a soldier with modern equipment and a blaster, an Ewok would be no more detectable by any fancy gizmos in their helmets than any other small animal in the undergrowth.
Stone-tipped spears couldn't penetrate their armour, but they *would* be irritating, and stakes in holes, hidden in the tangled undergrowth, might still cripple troopers.
In this confusion, the Rebel commandos were able to escape their shocked captors.
The Ewoks - probably under Chewbacca's supervision - had pre-prepared traps ready to take out the walkers (and presumably, off-screen, speeder-bikes) which - judging by what we see earlier in the movie - the Imperial garrison normally used to control the forest, and which did most of the Ewok-killing we see on-screen.
Chewie - who perhaps had experience in just this sort of war in the reisisance on Kashyyyk - probably did most of the work, and this was made easier by the presence of only one troop of AT-STs, and the fact that the biker scouts had apparently dismounted when they thought the battle was won.
The Rebels' capture of an AT-ST - far more suited to dominating the wooded surface of the Sanctuary Moon than stormtroopers - turned the battle from chaos to victory. Already dispirited, easy targets, and without any weapons that could take on armour, the stormtroopers had a simple choice - surrender or die.
So to sum up... Imperial stormtroopers were highly-trained shock troops, trained in close-quarters fighting, 'away team' missions and low-profile hands-on local patrolling - trained, in short, for the sort of situations where a high-tech superstate like the Empire would still normally have to use infantry.
Given missions that fell within their remit, they were precise, effective and deadly.
Their poor performance at Endor came about because they were forced to fight in a situation where their training, equipment and expectations were utterly useless, and this problem was compounded by the fact that they could not comprehend *why* or *how* they were losing.
And so, we can all watch RotJ secure in the knowledge that the Battle of Endor does, in fact, make perfect sense.
I like the film a lot better already.