Well they also prepared for a trenched war before the confrontation with the Nazy...
That the invasion of France ended the way it did was a surprise to everyone, including the Germans. Mainly you could boil it down to better command and control all the way from strategic to tactical and luck on the German side and the opposite, bad luck, bad cooperation and bad communication on the allied side.