From left, presidential candidates Sen. Bernie Sanders (I-Vt.), former vice president Joe Biden and Sen. Elizabeth Warren (D-Mass.) are introduced at the Democratic presidential debate Thursday night in Houston. (David J. Phillip/AP)

THURSDAY NIGHT’S debate among Democratic presidential candidates touched on the U.S. effort in Afghanistan, appropriately, since the United States had spent the previous day observing the 18th anniversary of the Sept. 11, 2001, terrorist attacks, mourning victims and pondering lessons learned. A few days before that, President Trump had pulled the plug on his own efforts to negotiate a withdrawal of the about 14,000 U.S. forces still battling the Taliban, demonstrating not only his own shortcomings in foreign policy but also the inherent difficulties of ending this “endless” war.

If only the Democrats could have articulated a plausible alternative, one that would end the U.S. troop presence while preventing Taliban-aligned terrorists from once again using Afghanistan as a sanctuary. The candidates failed. For the most part, they served up evasions and fantasies not much different from the cut-and-run impulse that at times seems to be animating Mr. Trump’s outreach to the Taliban.

The discussion needs to be informed by the lessons of Iraq, where, in 2011, then-President Barack Obama stuck to preexisting, but foreseeably unworkable, plans to get the last U.S. troops out — thus creating a power vacuum that the Islamic State filled. The resulting carnage required the United States to return and help defeat the Islamic State, at great cost in both dollars and lives.

On the debate stage, former vice president Joe Biden defended the Obama administration’s decision, then reiterated his long-held view that Afghanistan “will not be put together ” and that the United States should withdraw its troops, except for bases in Pakistan, from which it can strike at terrorists when the need arises. “We need to bring our troops home,” Sen. Elizabeth Warren (Mass.) declared, then served up cliches: “We’re not going to bomb our way to a solution in Afghanistan,” she said. “We need to treat the problem of terrorism as a worldwide problem, and that means we need to be working with all of our allies, our European allies, our Canadian allies, our Asian allies, our allies in Africa and in South America. We need to work together to root out terrorism.” Yet the current policy is multilateral: Thousands of allied troops are serving in Afghanistan; the government in Kabul says it wants to work with the United States against terrorism. Sen. Bernie Sanders (I-Vt.) was vaguest of all, promising to slash military spending, while making “it clear” that “we as a planet, as a global community, will work together to help countries around the world rebuild their struggling economies and do everything that we can to rid the world of terrorism.”

South Bend, Ind., Mayor Pete Buttigieg has actual military experience in Afghanistan but nevertheless offered no particular reason for his claim that securing Afghanistan does not “require an open-ended commitment of ground troops.” What if ground troops are the best, or only, way to keep a pro-Western government in Kabul, and if keeping such a government stable is the best, or only, way to prevent a terrorist resurgence? The United States has ground troops in South Korea and Western Europe decades after the shooting wars that brought them there, precisely because their stabilizing presence helps prevent war. Afghanistan is, to be sure, a much more dangerous environment, but U.S. combat deaths have numbered in the low double digits in recent years.

No one likes the status quo. But if Democrats know a less expensive and less painful way to accomplish U.S. goals, they have yet to describe it.