As the U.S. escalates its campaign against jihadists in Iraq and Syria, a new documentary offers a cautionary tale about putting too much faith in technology and forgetting hard-fought lessons from the past.

"American War Generals," which airs Sunday at 8 p.m. on the National Geographic Channel, looks at how the U.S. military recovered from its disastrous endeavor in Vietnam, remade itself into an all-volunteer force that focused on fighting conventional wars, and then came close to defeat in Iraq and Afghanistan as it faced a type of enemy it vowed never to fight again.

The documentary provides access to many of America's top current and former commanders, including retired Army Gens. David Petraeus, George Casey, Jack Keane and Stanley McChrystal and Lt. Gen. H.R. McMaster, currently with U.S. Army Training and Doctrine Command.

McChrystal provides the film's most candid and forthright commentary. The former head of Joint Special Operations Command, who went on to lead all U.S. and coalition troops in Afghanistan, waged a brutal war against al-Qaida in Iraq. Despite the U.S. military's successes in Iraq after 2006, he calls the invasion a mistake.

"Before that war, if we'd looked at the cost — not just in Americans but in Iraqis and others — if we'd looked at the distrust that it created — or loss of trust — around the world for America; I don't think a rational person would have ever said, 'Yeah that's worth it; we'll do that,' " he said.

"American War Generals" illustrates how the U.S. military did not train to fight guerrilla wars after Vietnam, preferring instead to prepare to fight large-scale conflicts against well-equipped, traditionally trained adversaries.

"Most of my professional life, the Army put Vietnam in the rear-view mirror and focused on this major conventional warfare," says Petraeus, a past commander of U.S. Central Command who led all coalition forces in Iraq and Afghanistan. "That's all well and good if that's what you end up fighting, but if you then end up in small wars, as they're called — counterinsurgency efforts — you then have to go back to the drawing board and do some serious thinking."

McMaster, who in 1991 led an armored cavalry troop during the Battle of 73 Easting in the Persian Gulf War, sets the stage for the history of the post-Sept. 11 wars by explaining that the U.S. military took away the wrong lessons from that conflict by believing technology had beaten Saddam Hussein's army.

"There are two ways to fight the United States military: Asymmetrically and stupid," McMaster says. " 'Asymmetrically' means, you are going to try to avoid our strengths. In the 1991 Gulf War, it's like we called Saddam's army out into the school yard and beat up that army."

When the insurgency in Iraq began, the U.S. military refused to accept that it was fighting an unconventional war, McMaster says.

"We didn't have enough forces for what the situation required and we didn't adapt fast enough, largely because in the beginning of the war in Iraq, we were in denial," McMaster says. "We were in denial about it. We wouldn't even call it an insurgency. We wouldn't call it an insurgency because it evoked the images of Vietnam."

The documentary also examines the tension between Casey, who opposed sending more troops into Iraq, and those who advocated for the eventual surge of forces there. Casey led all U.S. troops in Iraq from 2004 to 2007, before he became the Army's chief of staff. His philosophy differed from that of retired Gen. Jack Keane, who in December 2006 gave President George W. Bush a blunt assessment of the situation.

"I told him that we had run out of all options to succeed in Iraq but one," says Keane, the Army's former vice chief of staff. "I said 'There is only one thing that would be decisive and that is to change our strategy and begin to protect the people.' And I said 'You have to understand that right now the U.S. military strategy is not designed to defeat the insurgency. And based on his body language, I know he reacted to that statement."

Filmmaker Tresha Mabile co-produced "American War Generals" with her husband Peter Bergen. The documentary is the culmination of two years of work.

She hopes audiences take away that the U.S. military has to be able to fight different types of wars, she told Military Times on Thursday.

"War is a human endeavor and technology doesn't always solve all of the problems," Mabile said. "I think you heard that a lot from the generals in the film. Having been in war zones, you see that. War is a people venture and you just can't solve all problems by dropping bombs from the sky."

For Mabile, the most difficult part of making the documentary was selecting which scenes had to be left out to avoid the film running too long, she said.

"There was one point where the vice president called General Keane and said, 'We want you to go to Iraq and implement this strategy;' and General Keane said 'I'm retired; it would look like an act of desperation if you called me out of retirement; you need to get this guy Dave Petraeus on the ground and things will be OK,' " Mabile said.

Mabile also wishes she had more time to explain how the U.S. military was not trained to fight an insurgency at the start of the Iraq war. She believes Casey gets a "bad rap" for his tenure as commander in Iraq because it took time to retrain the military in counterinsurgency.

In "American War Generals," Casey explains how the death of his father — a two-star general killed in Vietnam — shaped the way he made decisions as an Army commander.

"I never made a decision to put forces in harm's way without thinking of the consequences," Casey says.

Casey also says he feels a connection with each of the more than 2,000 U.S. troops who died under his command during his tenure in Iraq. He still wears a bracelet with the name of a soldier killed in Iraq that was given to him by the soldier's spouse.

"I don't take it off," he says. "The cost — the human cost of war is something, as a leader, you can never allow yourself to forget."