When the outcome of a war is decided in a matter of hours, years before it actually ends, those involved rarely know it. So it was in northern France in May 1940.

At this moment Adolf Hitler was in a position to deliver such a devastating military defeat to the British that they might never have recovered. But Hitler hesitated. His panzer corps—fast-moving tank-led army divisions—had ripped through the defenses of France and Belgium and had trapped the British in a shrinking enclave around the French port of Dunkirk.

But then, on May 22, the panzers were halted by orders from above, and again on May 23. Just why this happened, and on whose orders, has been disputed for decades by historians.

What is not disputed is that if the panzers had been allowed to roll onward during those two days they could have driven the opposing British and French forces into the sea. Instead, the allied forces gained just enough time to be evacuated from the beaches of Dunkirk in the epic action now graphically recreated in Christopher Nolan’s movie, Dunkirk.

Twelve days before the panzers were halted, Winston Churchill had become prime minister. His position, like that of Britain, was tenuous. Without the successful evacuation of what was left of the British Expeditionary Force, BEF, Churchill might well have been out-maneuvered by colleagues ready to do a deal with Hitler.

As it was, few leaders in history have been saved so dramatically in such a marginal situation as Churchill was in those few hours in May. In 1945, as Hitler faced his own end, he complained that in 1940 he had given Churchill “a sporting chance” that Churchill had failed to reciprocate.

That was a misreading of Churchill, if not a self-serving revision of history. On May 28, when the feckless Belgian king surrendered to Hitler, Churchill wrote in a telegram: “Our only hope is victory and England will never quit the war whatever happens till Hitler is beat or we cease to be a state.”

Nonetheless, Hitler and many of those around him knew that some leading politicians and members of the aristocracy in London were having trouble locating their spines. A movement to appease Hitler in the belief that the British and Germans were not natural enemies had grown long before the outbreak of war and was far from expired; indeed, these people now believed that Britain was facing inevitable defeat and that Churchill’s bravado performances in public were more theatrical than rational.

What exactly had happened on the battlefields in Belgium and France?

After days of disorganized retreat the BEF had surprised the Germans on May 21 by staging a counterattack, using tanks and infantry, at the edge of the northern French city of Arras.

That counterattack seems to have unnerved a man who was to become perhaps the most proficient leader of panzer divisions, General Erwin Rommel. Rommel complained to the German commanding general, Field Marshal Gerd von Rundstedt, that his 7 th Panzer Division had been attacked by “hundreds of enemy tanks.” In fact, the British had deployed 74 tanks of which only 16 were the latest generation and able to outfight Rommel’s armor.

But the psychological effect of the unexpected resistance was more powerful than the British tanks. Von Rundstedt, with the support of Hitler, stopped the panzers driving toward Dunkirk and ordered that, first, the resistance at Arras should be dealt with.

Then, at 8 p.m. on May 23, another German commander warned von Rundstedt that other panzer divisions were moving so fast through Belgium and France that their infantry was falling behind the tanks and recommended that the tanks should be halted until the infantry had time to catch up. Von Rundstedt, again with Hitler’s consent, approved a pause of 36 hours, until May 25.

It was this second halt order that saved the BEF. It allowed the British time to establish new lines of defense between the port and beaches of Dunkirk and the German advance. Hitler had not consciously reprieved the British army. The two halt orders resulted from how the German generals read the battlefield at that moment—or, in fact, misread it. The panzers were ordered to resume the attack on the afternoon of May 26.

However, the day before, on May 25, the British had another extraordinary piece of luck. A small British patrol, moving on its own through the countryside, saw a German staff car approaching. A British sergeant, armed only with a pistol, fired at the car, killing the driver. The car crashed and the passenger, a German officer, leapt out and fled. Left in the car was a briefcase containing detailed plans for how the Germans intended to smash through the British lines in Belgium and then thrust directly to Dunkirk. British reinforcements were immediately sent to thwart the attack.

Moving those reinforcements effectively killed a planned counterattack on the Germans combining British and French forces. But the brutal truth was that the French had lost their appetite to defend their own soil with French blood. At that very moment a French general was telling a meeting in the Defense Ministry in Paris: “I believe in a very early capitulation.”

The French had simply not prepared for this kind of war. Early in May, just before the Germans launched their blitzkrieg, France Magazine reviewed the French army’s state of parade and reported: “One look at the comfort and elegance of these new uniforms is enough to convince us that we shall soon have the best dressed army in the world.”

It was true that, in theory, parts of the French army were well-equipped to deal with the panzers. They had tanks of superior firepower. But the French generals had failed to provide the tanks with competent support. They took too long to move into position and then to be refueled. Rather than concentrate their tanks the French generals dispersed them, leaving them vulnerable to the panzers that were always used in force.

In efforts to support the French army the British had jeopardized one of their most precious assets in the defense of England: the Royal Air Force. As the Nazis approached the English Channel the French appealed to Churchill for more air support, even as their army was collapsing. But on May 19 the RAF was ordered to urgently pull out of all their bases in Belgium and France.

They had already paid a heavy price: losses of the RAF’s two best frontline airplanes, the Hurricane and the Spitfire, had been high. Seventy-five of the 261 fighters sent across the Channel had been lost. And the evacuation was so hasty that 120 damaged but repairable Hurricanes were left behind. Only 66 fighters were able to fly back to their English airfields.

In London the leadership of the RAF was telling Churchill how few fighters remained to defend the homeland against what everybody knew Hitler was planning: a massive bombing campaign of English cities and military installations to soften up the country before an invasion. At the end of May the RAF had only 480 front line fighters left.

But by the end of May the outline of a near-miraculous military evacuation was taking shape. Not only had the Royal Navy turned up to ship out troops from both the harbor and the beach at Dunkirk. A motley fleet of merchant vessels and small leisure boats also sailed across from English ports. On May 29 more than 47,000 men were rescued, nearly three times as many as the previous day.

Each following day the numbers grew, to 68,000 on May 31. By June 4, effectively the end of the operation, 338,000 military personnel had been carried to England. That total included 125,000 French troops, who would form the nucleus of the Free French forces in England with the eventual hope of avenging their country’s abject surrender to the Nazis.

As astonishing and dramatic as the Dunkirk evacuation was, Churchill was wary of claiming that victory had been snatched from the jaws of defeat. “Wars are not won by evacuations” he warned on June 4.

The reality of what had happened on the battlefields of Belgium and France should not have given comfort to anyone. In a striking way Dunkirk was the culmination of a prolonged military engagement that had exposed how exactly armies reflect the cultural strengths and weaknesses of the nations that field them.

The British army was poorly led by a generation of old men steeped in the habits of imperial rule, unaware of how much military tactics and technology had advanced since World War I. A military career embraced the privileges of the class system and tended to attract the dimmest wits of the aristocracy. A large number of older officers were now found unfit to lead their troops in battle and had been summarily sent home. This, at least, had the effect of bringing sudden promotion to younger men, some of whom would bring fresh thinking to future battles.

The French military leadership reflected the age and fatigue of a society riven with political corruption and social unrest. As a result, military defeat was followed by the craven Vichy regime led by 84-year-old Marshal Petain. Hitler summoned the French generals to the same railroad car where the Germans had surrendered to France in World War I. In a few humiliating sentences the text of the capitulation was agreed. In just six weeks France lost the war and its freedom.

In Germany war was regarded as a science and the army as an academy. Hitler, giving priority to re-armament as soon as he took power, had combined the professionalism of the old Prussian war machine with a new generation of weaponry. The British invented the tank but it was the Germans who had learned better how to use it. In the rear they still used horses for transport but at the front they deployed formidable armor and gave the panzer divisions close air support.

Their only impediment was Hitler, who regarded himself as a military genius. His commanders, like von Rundstedt, were always careful to give Hitler the sense that he was a partner in their victories while fearing his response to any failure.

Early in June, as the survivors of the flotilla of ships sent to Dunkirk returned to their harbors, a top British general noted: “I still cannot understand how it is that the Bosches [Germans] have allowed us to get the BEF off in this way. It is almost fantastic that we have been able to do it in the face of all the bombing and gunning.”

Churchill knew his army was shattered. Its ranks were seriously depleted and its leadership required a generational shake-up. But Dunkirk quickly acquired the quality of a popular myth that played into Shakespearian narratives of national resilience and glory. Aware of its value to morale, the prime minister did not resist the sentiment in public.

In private at that moment he received a secret plan to evacuate the government and the royal family, together with the crown jewels and Coronation throne, “to some part of the Overseas Empire.”

He instantly rejected the idea, writing privately in a memorandum: “I believe we shall make them rue the day they try to invade our island.”