A member of Iraq’s security forces holds a rocket-propelled grenade as he stands guard on the outskirts of Ramadi a few weeks after the town was retaken from the Islamic State. (Agence France-Presse via Getty Images)

There’s a scary disconnect between the somber warnings you hear privately from military leaders about the war against the Islamic State and the glib debating points coming from Republican and Democratic politicians.

The politicians fulminate about defeating the terrorists, but they don’t talk much about the costs or sacrifices that will be required. The generals and admirals, who have been at war for 15 years, know that success can’t be bought cheaply. Defeating this enemy will require a much larger and longer commitment by the United States than any leading politician seems willing to acknowledge.

My visit here last week to the headquarters of Central Command, which oversees all U.S. military activities in the Middle East, came as part of a conference organized by the Center for Naval Analyses, which provides research to the Navy and other services. The ground rules prevent me from identifying speakers by name, but I can offer a summary of what I heard. It’s not reassuring.

Military leaders know that they are fighting a ruthless adversary that has adjusted and adapted its tactics as the United States and its partners have joined the fight over the past 18 months. The jihadists have lost about 25 percent of the territory they held in mid-2014, but they have devised innovative methods to compensate for their weakness.

Some examples illustrate the agility of Islamic State commanders: They have used tunnels and other concealment tactics to hide their movements; they have developed super-size car bombs, packing explosives in bulldozers and other heavy equipment and sending them in waves against targets; they have deployed small drones for reconnaissance and may be preparing armed drones; they have used chemical weapons, such as chlorine and mustard gas, on the battlefield and may expand use of such unconventional weapons.

The Washington Post gives an insider's look at the Islamic State's propaganda machine and its influence throughout the world. (Jason Aldag/The Washington Post)

U.S. commanders have learned how difficult it will be to create a Sunni force that can help clear and hold territory in Iraq and Syria that’s now controlled by the Islamic State. Sunni tribal leaders mistrust the United States and doubt U.S. staying power. U.S. efforts to avoid casualties and resist “boots on the ground” reinforce the sense that the United States is pursuing a strategy of containment, not victory.

One painful learning experience has been the Pentagon’s $500 million “train and equip” program to build a Syrian opposition force that can help assault the Islamic State and hold territory afterward. That effort collapsed last year because many expected recruits didn’t show up and the few who did were mauled on the battlefield. Among the lessons learned are the difficulty of finding and training mature fighters; the shifting and unsteady combat environment in Syria; and the difficulty of working with regional partners, such as Turkey, that have their own agendas.

The deeper lesson is that training a reliable military force that adheres to Western norms and standards is the work of a generation, not a few months. The U.S. desire for quick results is an exercise in frustration and disappointment. The sobering reality of this conflict that politicians — and the American public — seem least willing to face up to is that it will require a decades-long commitment.

Paradoxically, the United States’ determination to protect its troops can be self-defeating. Allies and adversaries see U.S. forces living in secure compounds, eating fancy chow and minimizing their exposure to potential terrorist assaults. The United States may say it’s fighting alongside its allies, but on the ground, it often looks different. Actually living and fighting alongside our partners in Iraq and Syria will be much more dangerous, but it may be the only way to build a solid alliance that can someday eradicate the extremists.

Contrast these stern admonitions from the commanders who have lived through the Iraq and Afghanistan conflicts with the upbeat talk from political leaders. President Obama pledged that “priority number one is protecting the American people and going after terrorist networks” and then said a few moments later that these networks “do not threaten our national existence.” That sends a mixed message — one that Hillary Clinton has echoed in her campaign.

Republican rants about the Islamic State are even worse, in that they promise total victory without suggesting the level of commitment and sacrifice involved. The GOP responses sound tough, from Donald Trump’s “bomb the hell out of [the Islamic State]” to Sen. Marco Rubio’s (Fla.) assurance in last week’s debate that “the most powerful military in the world is going to destroy them.”

The next president is going to inherit an expanding war against a global terrorist adversary. The debate about how best to fight this enemy hasn’t even begun.

Read more from David Ignatius’s archive, follow him on Twitter or subscribe to his updates on Facebook.