WWI was really the first war of the industrial age, the first really modern war. Other wars came close-the American civil war(the battles at Cold Harbor, the sieges of Vicksburg and Richmond all involved trench warfare. So did Gettysburg after the first day) and the Franco Prussian war(this conflict involved rapid fire guns the predecessors of machine guns) and the Russo Japanese war(where Japan lost 60% of their army in one mass frontal assault on Port Arthur)-but they lacked the enhanced lethality that science and mass production created in WWI.
WWI featured such innovations as the machine gun, poison gas, attack aircraft, submarines and tanks. there are many reasons why trench warfare was important but the simple answer is that armies on the offensive were less powerful then those on the defensive. One machine gun well sited could neutralize a battalion of infantry. Add to that riflemen in trenches(only the head would be visible), supporting fires (artillery) controlled by telegraph(or radio-in real time), with a impassable obstacle in front (barbed wire usually) and you can see that the attacking infantry is at a considerable disadvantage. Confounding the problem was that many generals were slow to realize the changes that technogly had wrought. Many military and national leaders assumed that WWI would be like the wars of the middle ages-limited in scope and duration, fought by small professional armies and that's how they tried to fight the war at first.
for more see the links