From Your Quora Digest
Because the machine guns they had then were enough of a mature technology to be able to fire for hours on end.
This is a Vickers machine gun. Notice the giant barrel. That's not actually a barrel, that is the water-filled cover for one. The water is poured into the shroud and the water boils, then condenses inside the hose attached to it, and drains into a can. Your pour the can right back into the gun and continue firing.
Anyway, once infantry go "over the top" and charge at the enemy, the artillery will fire and take out many, many men. The the machine guns begin to cut swaths of men down, the ones who got through the artillery. Nobody will live long enough to actually hold any ground because of the amount of firepower the machine guns can bring to bear. When people call them "bullet hoses", it has a literal meaning. These things could fire until a jam happened, the ammo ran out, or the enemy ran out of men to throw at it.
Edit 1, Raghupathy Srinivasan added that the machine guns were also combined with barbed wire to make a death trap for advancing infantry. Don't believe us? Check this out below!
Edit 2, Tim van der Wal pointed out that this is a diagram of tank obstacles followed by barbed wire, probably of a Finnish defensive line. The principle is the exact same, however :)
The schematic is admittedly crude, and I actually did not create it. But you can see how the wire is not laid out in straight lines. This way, you create interlocking fields of fire for each machine gun. If you have enough time, you can also zero in friendly artillery or mortars to fire in the event that the enemy starts to attack through the wire.
World War One soldiers were not stupid, trench warfare was complicated and a matter of military science and tactics that have constantly evolved. This kind of stuff is still used today. From the Bar Lev Line...
To Dien Bien Phu...
Trenches will never be outdated, especially against foes without significant artillery or air power.