And as a supplementary question why wasn't the European front in WWII fought in the same way?
World War One was the war it was (in the West) because of the confluence of two major factors. The first was the power of rifled weapons, and especially artillery. Interestingly, artillery killed more men (in both World Wars), than bullets ever did. By 1914, artillery was accurate, it fired quickly, and it could remain in action for prolonged periods of time (so long as the enemy didnt destroy it, or force it to move). This combined with innovations in ammunition, which meant that anything from High Explosives to Shrapnel and gas, ment that artillery was a versatile weapon. Thus, trenches came about as a response to the need to protect troops from such devastating artillery. Troops in the open would often find themselves ravaged by artillery before they ever joined battle with the enemy infantry. Trenches concealed these troops, gave them greater protection, and multiplied their defensive power.
This isnt to say that the increased accuracy and power of rifled small arms had nothing to do with trenches though. Infantry, and especially machine guns, were powerful on the defensive. But without proper cover, the defensive troops would suffer just as heavily as those on the offensive. So trenches the perfect defensive solution to an offensive problem.
But then, why did war become so static? There is the second problem. After the defeat on the Marne River, the German army pulled back to defensive positions, which it dug deeply into the French soil. And the longer they sat in those positions, the more impenetrable they became. The trench system rapidly became a potent obstacle for both sides. The solution, it seemed, was to utilize a powerful bombardment of the trenches which would break them up (by physically smashing them with High Explosives) before an infantry assault. But this rarely worked, and Infantry was often forced to assault positions which were generally intact. And they had to do so after crossing soil which had been pulverized by hours, or even days, worth of bombardment. It was almost impossible to attack with any speed, in the face of stiff opposition, over well broken ground. Yet the enemy could rely on well built railroad lines (which were increasingly built up along with the trenches), and a relatively intact supply line. It was very difficult to cut these, even with the aid of spotters and large caliber artillery, because the artillery could only fire so far, and defenses incorporated that. Even if the attacker could capture the first trench system or two, the follow up troops (and supplies, and artillery train) would have to cross over the same broken, torn up, ground the first wave did. That meant support and reinforcements could only come through so fast, and artillery was virtually static for a days assault. But for the defender they could always rely on that well built rail network to ferry troops and supplies across the battlefield, just out of artillery range, and over "normal" ground.
So why was WWII different? That also has two reasons. The first is that WWII was a complete reset. Trench Warfare only became a major factor in the West following the failed German attacks on Paris, and on their left. But in World War Two, the French and British were both trying to rush the Germans to establish good positions in Belgium to do just that, foil the German attack. Had they succeeded, that war would have resembled World War One. But they didnt, and the German attack move so quickly that defenses couldnt be set up. One could say the same about virtually every front of the War. Wherever defenses were built, they were quickly overrun and rendered obsolete by the attackers.
And thats because a huge gap had opened up in the equipment of modern armies. Tanks and trucks had become the main attacking force of virtually every army, they moved fast and hit hard. But the common infantryman still walked into battle (and the German army always relied more on horses than vehicles to pull their supplies and artillery). So the defender was never able to march troops to seal a breakthrough before the mobile troops exploited said breakthrough. On the defensive, tanks could be used to eventually stop the attack, but by that point the front have moved tens, dozens, or even hundreds of Kilometers. So there was no cratering or repeated pulverizing of the battlefield. Combat was too brief for that. And defensive positions were often abandoned so quickly that they never had the chance to develop as elaborately as they did in World War One.
But all this penetration and breakthrough (which tanks could then exploit) was all caused by the great Achilles Heel of the trench system: Hutier Tactics (or small-unit tactics). Pioneered by the Russians during World War One, the Germans quickly adopted Hutier tactics. It called for a very brief, but incredibly intense bombardment of the enemy positions during which, groups of elite troops (in World War One they were called Stormtroopers) armed with Flamethrowers, grenades, and gas would cross No-mans-land. As soon as the bombardment finished, the troopers would jump into the enemy trenches and (hopefully) catch the defenders by surprise. Not all of these small units would succeed, but where they did regular infantry could follow up and safely cross No-mans-land. While the regulars cleaned up, the bombardment would shift to the next line and the stormtroopers would start again.
In this manner, the Germans were actually able to push the French back to 1914 positions before a shell-shortage and the arrival of fresh American troops broke the offensive. But in World War Two, these tactics would form both an tactical and operational concept, where small teams and units would probe the enemy for weak spots, quickly seize key positions, then allow strong units to launch follow up attacks and clean up operations. This was all augmented by tracked and wheeled vehicles, which could convert small gains into large exploitations, which in turn placed a greater emphasis on the proper infiltration and reconnaissance of enemy positions. Also, this worked well on the operational level, the Soviets would become masters of this by using "Shock" armies to seize strong positions and create a breakthrough in the front, where tank armies would exploit and wreak havok.