Did they think that the Maginot-line would stop them dead in their tracks?
The french thought they would be able to stop the german by using a combination of the maginot line to lock the alsacian front and by reinforcing the belgian army with their best unit (and the british expeditionary forces). The plan was to fight the german away from french home territory while the french army was fully mobilizing their reserve. Then eventually go on the offensive.
The german send 3/4 of their panzer divisions rushing through the Ardennes forest, south of belgium, followed by Motorized Infantry division.
The ardennes were not complently defensless, but the allies did not think a massive armored forces could traverse the hilly and densely forested area so quickly and reacted too slowly.
The armored corps of the german managed to pass throug the Ardennes, cross the river Meuse and breaktrough at Sedan. Then they rushed toward the sea and cut off the main allied army in north of France and Benelux.
The allied were badly coordinated and too slow to react to the push, and their doctrine and organisation was not the best suited for quick counter attack.
When you read accounts of the battle of France day by day, you realized that the german armored push was extremly risky and was not originaly planned to be so fast. The panzerdivisions were at some point advancing without waiting for the infantry division supposed to consolide the frontline.
To summurize: The battle of France was by no mean a lost cause, and the swift and total victory of the german during this campaing was as surprising to the world as to the german themselves.
Also, the Maginot line served its purpose, the german never really manage to cross it up and had to go around it.