A Collection of Unmitigated Pedantry has a post on why trench warfare in the First World War worked out the way it did and why a stalemate and huge numbers of casualties are inevitable. It doesn't have anything to do with stupid or uncaring generals (though those certainly did exist) but with technology.
The trench stalemate is the result of a fairly complicated interaction of weapons which created a novel tactical problem. The key technologies are machine guns, barbed wire and artillery (though as we’ll see, artillery almost ought to be listed here multiple times: the problems are artillery, machine guns, trenches, artillery, barbed wire, artillery, and artillery), but their interaction is not quite straight-forward.