This year marks the centennial of two landmarks of modernity: World War I and Franz Kafka’s “The Trial.” Both events have their origins in 1914, but neither ever truly ended: Upon his death in 1924, Kafka left behind an unfinished manuscript, while the peacemakers at Versailles left behind an unresolved war. Beyond their incomplete natures, however, the two events have much else in common with one another, and with us as well.

A visit to a library will confirm what you probably already suspected: Few works of our age have lent themselves to more interpretations than World War I and “The Trial.” We continue to debate the origins and nature of the war, just as we still wrestle over the origins and meaning of Kafka’s greatest novel. And yet, the narratives for neither are terribly complicated. In the one case, the assassination of Archduke Franz Ferdinand in Sarajevo, Bosnia sent ever more violent shudders across the web of treaties binding various countries, climaxing in the spasm of war. In the other case, a mid-level bank manager named Joseph K. wakes up one fine morning to find his apartment commandeered by strange men. Representing a shadowy legal system, they announce, between bites of K.’s breakfast, that he has been charged with an unidentified crime. One year later, still ignorant of his crime, K. is executed in equally farcical circumstances.

Many claim that “The Trial” foretells the totalitarian ideologies that would soon engulf Europe. Perhaps. But at the very least, Kafka’s uncanny gift of clairvoyance also revealed the nature of the war that had only then begun to unfold.

On August 4, when Great Britain declared war on Germany, Henry James wrote that the modern age’s belief in progress had been given the lie: “To take it all now for what the treacherous years were all the while really making for and meaning is too tragic for any words.” Even more potent, however, is Kafka’s diary entry, written two days earlier: “Germany has declared war on Russia. — Swimming in the afternoon.” In a way, this was his preemptive response to James’s lamentation. Rather like Joseph K.’s reaction to his arrest — “Of course I’m surprised, but by no means greatly surprised” — it paralleled most Europeans’ response to the news of war. But Kafka, unlike James, knew better than to seek meaning in the unfolding events.

Of course, Kafka did not fight in the war he writes into his novel. Instead, he remained at his post in Prague as a lawyer with an accident insurance company. When he eventually tried to enlist, the medical examiners took one look at Kafka’s emaciated and consumptive frame and sent him packing. Yet the war nevertheless came to his native city. From the edges of the crowd, Kafka watched military marches and listened to patriotic speeches, noting that they were “well-organized and slated to be repeated every evening, twice tomorrow and Sunday.” All the while, he was increasingly isolated as Prague emptied of his friends, now mostly in uniform.

What to do? Write, Kafka told himself — only writing, he insisted, could assist his “struggle for self-preservation.” And write he did. At the very moment the European powers called one another’s bluffs, Kafka’s diary recorded the birth of a character named “Joseph K.” The process of writing K.’s story, which developed into a novel — now titled “The Trial” — resembled the fortunes of the Austrian army, retreating as often as it advanced. Kafka lamented that his writing was either at a “standstill,” “[going] forward at a miserable crawl,” or that he had “come up against the last boundary.” As the number of Kafka’s chapters increased, he visited a model trench dug for the edification of civilians in the center of Prague. He noted that the pristine ditch contrasted with “the antlike movements of the crowd” swarming around it.

By the time of that visit in 1915, Kafka had written all he would, or could, of “The Trial.” He gave the manuscript to his friend Max Brod, who eventually assumed the task of restructuring a work seemingly impermeable to such efforts. Often when we pick up a book, after a few dozen pages we’re able to recognize what it is that we’re reading. We grasp its type and structure; we know where it fits on the shelf. But this is not the case with “The Trial,” in which the protagonist, charged by a shadowy court with an unnamed crime, spends what remains of his life futilely seeking those who have set the legal wheels in motion and, presumably, know why. It is a world that seems familiar, yet is terrifyingly alien, governed by laws — if there are laws — beyond our moral comprehension.

What is true of books is also true for wars: Statesmen and generals know the sort of war they are fighting after a few battles. This was not, however, the case with 1914, where events surged in monstrous and unprecedented ways, confounding the plans so meticulously prepared by general staffs. Everyone imagined, noted the historian A.J.P. Taylor, that it “would be an affair of great marches and great battles, quickly decided.” Yet, on the Western front, as French and German forces tumbled and tried to outflank one another, they dead-ended at the Channel. The contest ossified into a war of static lines, creating an utterly new landscape. Or, rather, underscape, for WWI was a subterranean war: On the Western front alone more than 25,000 miles of trenches were dug.

But how can we wrap our minds around this fact? One’s actual and moral horizon was reduced to the ridge of a trench — a “stinking world of sticky, trickling earth ceilinged by a strip of threatening sky,” noted one officer. Life, when not punctuated by suicidal attacks across no-man’s land, was spent repelling similar attacks or weathering chronic squalls of artillery fire. In the end, the adversary was not the German or Austrian, Frenchman or Brit, but the war itself — a basic datum of life that seemed everlasting and no more offered reasons or justifications for its existence than the judicial system that absorbs K.

The oppressive city K. traverses concretizes the war’s troglodytic world. He stumbles down dank, trench-like streets, and lurches into narrow courtrooms, but is stymied in his effort to learn the reason for his predicament. Like those enmeshed in a war seemingly beyond human control and comprehension, K. cannot escape a “judicial organism that exists in a state of eternal equilibrium.” In both cases, the individual is powerless and, K. realizes, must “learn to accept existing conditions”; in both cases, as a British officer remarked about the war, “a man disappears without anyone noticing”; in both cases, be it war propaganda or legal claims, the priest’s last words to K. obtain: “You don’t have to consider something true, you just have to consider it necessary.”

In a letter to a friend, Kafka declared: “If the book we’re reading doesn’t wake us up with a blow on the head, what are we reading it for? We need books to affect us like a disaster.” He wrote these words in 1904, 10 years before the disaster of World War I. It delivered a blow on the head from which the world still reels, one that “The Trial” can help us process.

Robert Zaretsky is a professor of history at the University of Houston.