I read somewhere that a large part of the reason the Germans did not wipe out the BEF at Dunkirk was that Hitler thought he could negotiate an "Honorable Peace" with the British and save the effort of invading. I'm sure there were a lot of reasons both for and against.
Either way the British got lucky.
Always fascinates me how other country's armies celebrate only their victories but the British celebrate gallant defeats almost more. Dunkirk, Light Brigade, Karthoum etc