This summer saw two powerful books about war that tell essentially the same story. One is a work of fiction, born out of personal experience. The other is a brilliant reporting job. One is about Vietnam 40 years ago, the other about present-day Afghanistan, but they both delve into the age-old question of what motivates men to endure the horrors of combat, and man’s strange addiction to it.

It took the reporter Sebastian Junger a year embedded with an army unit to write “War,” essentially a story about a small group of soldiers that dig a lonely fire base named “Restrepo,” after a fallen comrade, out of the steep highlands of Afghanistan. It took Karl Marlantes 30 years to write “Matterhorn,” a novel about a small unit of marines who must take and hold an ironically named hill in the ghost-haunted jungles of Vietnam.

Restrepo is hard by Pakistan, where the enemy enjoys sanctuary to infiltrate into Afghanistan. Matterhorn is near the border with Laos, where the enemy found sanctuary and infiltration routes in that long-ago war. The Taliban, like the North Vietnamese before them, win grudging respect for their mastery of tactics and terrain to overcome the massive advantage in fire power that the Americans enjoy. The Taliban try to neutralize superior firepower by working in so close that Americans will want to avoid killing their own men. The Vietnamese called this “grab them by the belt.” and did the same thing in the jungles of their country.

The story of small, embattled fortresses held by a few men is always compelling. The Alamo, where all the defenders were killed, is woven into the American narrative. In fiction think of “Fort Apache,” or before that Beau Geste’s “Fort Zinderneuf”’ in the Sahara, where French Legionnaires are surrounded by hostile Arabs.

Both Junger and Marlantes tell us that men risk extreme danger and death in wars not so much for king and country, but for their “band of brothers,” as Shakespeare wrote long-ago. It’s the cohesiveness of the unit that makes men do what they do in combat.

The dry-mouthed fear that can be incapacitating before a battle affects Junger’s soldiers as well as Marlantes’ marines — as it did King Harry’s men the night before Agincourt half a millennium ago, and as it undoubtedly was for the Spartans awaiting the onslaught of the Persians at Thermopylae. “All dread and none of the adrenaline” that often washes fear away when combat actually commences, as Junger puts it.

Forty years have seen changes in the U.S. military. There are more Hispanics in Junger’s tale, reflecting the changing demographics of America. Junger, who reviewed Marlantes’s book for this newspaper, wrote that the racial tensions in Vietnam, the “military callousness or incompetence” that Matterhorn reveals “would be virtually inconceivable today.” But Vietnam was fought by mostly draftees, quite unlike today’s all-volunteer army.

The essentials have not changed, however. Junger, who has read just about every book imaginable on the psychology and physics of war to enhance his personal experience, tells us that the sound of a bullet snapping as it goes by your ear is actually the “sound of a small object breaking the sound barrier inches from your head.” When I first experienced this phenomenon it sounded to me like the snapping sound that some insects make in the air. The more poetic Marlantes refers to bullets “cracking like the bullwhip of death.”

Perhaps the most disturbing thing about both books is their recognition that the adrenaline produced by combat, and the brotherhood that combat can generate, is as addicting as heroin — and for some it makes everything else in life seem boring. Marlentes has one of his characters say that when his buddy gets home, “you’ll try to tell everyone how bad you were and how sorry you are so you won’t have to explain how it really is. How good it can feel to do something so bad.”

Matterhorn’s fictional marines and Junger’s real soldiers find themselves re-enlisting and yearning to return when common sense might argue that they never go near a war again. This may be a form of mental illness, a disorder brought on by trauma and stress. Junger, who can tell you what chemicals combat releases in the brain, says that it’s not the killing: “Collective defense can be so compelling — so addictive ... .”

“Civilians balk at recognizing that one of the most traumatic things about combat is having to give it up. War is so obviously evil and wrong that the idea there could be anything good to it feels almost like a profanity.” People who think about world peace need to think about that, Junger writes.