World War I caused many people to think that western civilization was in decline and that it had become wantonly self-destructive. Part of the impact of this kind of thinking can be seen in the fairly pessimistic poems of writers such as T. S. Eliot, particularly in such poems as The Waste Land.
eNotes, as might have been expected, has a nice discussion of this:
Modernism was a response to industrialization, and the effects of industrialization on humanity. Our society changed greatly over the 19th century, and by World War I it must have seemed like the world was a truly horrifying, pretty hopeless place.
An argument can be made that both WWI and Modernism grew out of the same set of changing circumstances.
Governments and nations were in a state of flux paralleled a flux in "man's state of being", which turns inward in Modernism, exploring what happens internally to a person as the historical and external modes of identification are outrun by the burst of industry, commerce, automobiles, powered flight, and the rest of the suite of changes taking place from the late 1890s to the end of WWII.
Many modernist writers were in WWI or saw first-hand the effects of that devastating war on the people involved. One notable example is Earnest Hemingway. He and others became disillusioned about the nobility of war and traditional ideas of heroism and valor. They started to question the the value of many traditional ideas including ideas about writing. They wrote in a very realistic vein and challenged their readers to discern the meaning of a story as opposed to providing a tidy ending with the theme made explicit.
I meant topic