What is the purpose of the North Atlantic Treaty Organization? And is it worth the cost? Would the American people really be willing to treat an attack on any one of the 28 other NATO members as an attack on the United States? As Tucker Carlson put it to President Trump in an interview last week, “Why should my son go to Montenegro to defend it from attack?” Trump replied, “I understand what you’re saying. I’ve asked the same question.”

Americans have been asking such questions for a long time, but especially since they soured on the wars in Iraq and Afghanistan. Today, almost nothing would persuade the American people to support the deployment of U.S. troops overseas—not even chemical weapons attacks on civilians, as we’ve seen in Syria since 2013.

Now, we have a president who is deeply suspicious of alliances like NATO that commit the United States to military action abroad. The Tucker Carlson interview came on the heels of Trump’s recent meeting with NATO allies in Brussels, where he urged members to double their military spending, calling them “delinquent” because the United States “has had to pay for them.”

This is a longstanding complaint of U.S. administrations going back to Reagan, and not just with members of NATO but a host of other U.S. allies. In Trump’s view, America’s alliances should be more or less transactional. He has long conceived of U.S. interests narrowly, in nationalist terms, and criticized the post-Cold War international order as a sucker’s deal for the United States. These attitudes coincide with questions about NATO’s proper role and mission that remain largely unanswered almost 30 years after the end of the Cold War.

He’s not the only one who thinks so. A recent Reuters/Ipsos poll found that nearly half of Americans believe the United States should not have to defend its NATO allies if they don’t spend more on defense, including two-thirds of registered Republicans and nearly four in ten Democrats.

It’s impossible to explain this erosion of support for NATO without recognizing the role that Iraq and Afghanistan played in undermining American confidence in the U.S.-led international order. In a democracy, military alliances like NATO are only useful if they enjoy popular support. If an alliance loses that support, it loses cohesion. One of the lessons of Iraq and Afghanistan is that America can’t sustain long-term nation-building occupations without undermining support for military alliances that call for deploying U.S. troops overseas.

Popular opinion has always been a check on the use of American military power, but the experience of the past decade-and-a-half in Iraq and Afghanistan should leave no doubt about how alliances like NATO should work: to sustain public support, America and her allies must keep their military actions targeted and brief. No more regime changes, occupations, or nation-building. No more Iraqs or Afghanistans.

But it also means that in order to maintain a peaceful and stable global order, Americans are going to have to stop thinking of military force as a last resort and recognize that if we want to avoid large-scale conflicts, we might have to use force more often. If NATO is going to have purpose and cohesion in the twenty-first century, it will have to be as a global expeditionary force that conducts targeted missions to solve problems before they require large-scale military intervention.

A Short History Of America’s Inconsistent Foreign Policy

For that to happen, Americans are going to have to come to terms with what happened in Iraq and Afghanistan, and understand that not all U.S. military deployments overseas have to become massive long-term occupations that never seem to end in victory.

It’s easy to understand why so many Americans feel this way. Fifteen years after the United States invaded Iraq and toppled Saddam Hussein, the country is a mess. Riots are raging across southern Iraq, parliamentary elections in May have yet to produce a government, and the most influential player in Iraqi politics right now is Iran. So much for President George W. Bush’s dream of Iraq as the vanguard of a revolution that would democratize of the Middle East.

As for Afghanistan, seventeen years after U.S. forces first deployed there in the wake of 9/11, we still have 15,000 troops in the country, the Taliban control vast swaths of territory, and ISIS now has a foothold in the north. Despite Trump’s initial opposition to America’s longest war, he was persuaded by advisors to increase troop levels, although there has been no dramatic change in overall U.S. strategy in Afghanistan, and no plans for such a change.

Whatever successes we’ve had in Iraq and Afghanistan, the perception among the American people is that these wars have been colossal failures. A majority believe that we never accomplished our goals in Iraq and remain deeply skeptical of ongoing U.S. engagement in Afghanistan.

It’s been this way for a while. Barack Obama was elected president in 2008 largely on an anti-war platform. Once in office, he sought to diminish U.S. leadership abroad, especially in the Middle East, convinced that American involvement was the source of the region’s instability, not the solution to it. Elsewhere, his administration infamously pursued a policy of “leading from behind,” with predictably disastrous consequences, particularly in Libya, the birthplace of Europe’s migrant crisis. Obama might have used the language of liberal internationalism, but like Trump, his goal was always to revise the American-led world order, chiefly by reducing America’s role in it.

Like Obama, Trump opposed the wars in Iraq and Afghanistan, and regularly excoriated the Bush administration on the campaign trail in 2016—a tactic that proved popular. But while Obama and Trump arrived at similar conclusions about America and the international order, they got there by very different routes. Obama wanted to pull back because he doubted American strength, but Trump wants to pull back because he thinks we’re so strong we don’t need an international system at all.

Both of these views depart from the traditional post-war understanding of America’s place in the world. After World War II, successive American administrations built and sustained an international system that was designed to serve American interests by pulling much of the world into a rules-based system of alliances and trade underwritten by U.S. economic and military might. The system worked insofar as it helped rebuild a shattered Europe, contain an expansionist Soviet Union, and ultimately defeat communism. The Korean and Vietnam wars were of course products of Soviet containment doctrine, but they were catastrophic strategic mistakes: Korea was preventable and Vietnam was unnecessary.

Even with these mistakes, the system held together. The post-Cold War order that emerged after the collapse of the Soviet Union built on this system, promoting free trade, multilateral agreements, and international institutions. Although the benefits of globalization were spread unevenly in America, on the whole the international order promoted economic prosperity at home and stability abroad.

As for military conflict, the liberation of Kuwait in 1991 was perhaps the finest hour of the post-Cold War international order, when the United States led a coalition of 34 countries to expel Iraqi forces from a defenseless nation. Desert Storm was supposed to be an exemplar of what then-President George H.W. Bush called the new world order: an era of international cooperation and global stability underwritten by American military power. The war was broadly supported by the American people at the time and still considered worthwhile a decade later.

NATO’s original purpose was of course to prevent Soviet expansion into western Europe after World War Two. But the Balkan wars of the 1990s, which arose from the breakup of Yugoslavia, prompted NATO’s first major post-Cold War operations and represented a shift in the alliance’s mission, from checking Soviet expansion to imposing peace on the European continent. Like the Gulf War, the NATO interventions in the Balkans in the 1990s were broadly supported by the American people. Notably, the 1995 campaign in Bosnia found more public support for allied, as opposed to unilateral, action.

Still, to remain relevant in a post-Soviet world and justify the enormous expense of maintaining the alliance, NATO needed a broader and more strategic mission than preserving stability in former Yugoslavia. As the Bush administration came into office, there was increasing consensus that NATO needed to embrace—and be capable of fulfilling—a global expeditionary role in defense of its members’ global interests. The pretext for precisely such a mission did not take long to materialize.

The attacks of September 11 were the first and only time that Article V, the self-defense mechanism of the NATO treaty, has ever been invoked. The Bush administration’s response called for “draining the swamp” of terrorist safe-havens, and NATO embraced that global expeditionary mission when it went into Afghanistan.

The invasion of Iraq soon followed, and by 2006 Americans had soured on the Iraq War. By 2008, Obama’s anti-war message was resonating with a growing number of Americans, many of whom were (and are) disillusioned with American military intervention abroad, whether as unilateral action in Iraq or as part of NATO’s mission in Afghanistan.

So What About NATO?

All of this brings us back to the current status of NATO. For all Trump’s bluster, the alliance is not in danger of breaking up anytime soon. At the close of the recent summit, Trump reaffirmed America’s commitment to NATO and signed the official communique, which stated that an “attack against one Ally will be regarded as an attack against us all,” reaffirming Article V of the NATO charter.

But questions about NATO’s purpose and structure persist. A growing segment of the Right, especially among those in the Republican Party who subscribe to Trump’s “America First” view of foreign policy, have little use for NATO as it is, much less the myriad institutions that comprise the international order.

The question is not whether the United States and NATO should have acted after 9/11, but whether the invasion and long-term occupation of Iraq and Afghanistan were the right decisions.

It’s not just Trump’s base on the Right. Earlier this year, one survey found that more than 86 percent of respondents believe America should use military force only as a last resort, and 57 percent believe U.S. military aid to foreign countries is counterproductive. Moreover, the desire for military restraint was bipartisan, with 78 percent of Democrats, 64.5 percent of Republicans, and 68.8 percent of Independents favoring restrained military actions overseas.

Polls like this are important, because if the last 15 years of foreign wars have taught us anything, it’s that America can’t sustain a protracted military conflict or pursue grand strategy across administrations without popular support. The result has been chaos in America’s posture toward the world. Much of Obama’s foreign policy was a reversal of eight years of Bush’s foreign policy, just as Trump has pulled out of many key Obama-era initiatives like the Paris climate accord and the Iran nuclear deal. This is precisely the instability and inconsistency that alliance treaties are supposed to prevent, to protect foreign policy from the vagaries of public opinion by institutionalizing it.

That’s why the wars in Iraq and Afghanistan were so disastrous for American foreign policy. They soured the American people on maintaining long-term strategic alliances like NATO, as well as the post-9/11 role of NATO as a global expeditionary force.

Of course, after 9/11, inaction was not an option. At the very least, the United States had to move against al-Qaeda and the Taliban in Afghanistan. Once America invoked Article V, NATO also had to take action. If it hadn’t, Article V would have been proven worthless, effectively ending the alliance.

So the question is not whether the United States and NATO should have acted after 9/11, but whether the invasion and long-term occupation of Iraq and Afghanistan were the right decisions. In hindsight, they weren’t—and not just because the outcomes of those wars have been inconclusive or because they cost us in blood and treasure. They were the wrong decisions because the American people were never going to tolerate long-term nation-building abroad. Seen in this light, America’s inability to maintain strong support for military alliances like NATO is one of the worst and most enduring legacies of the Iraq and Afghanistan wars—one that will be with us long after the Trump administration.

Iraq and Afghanistan were in a sense doctrinal mistakes of NATO theory that proved to be incredibly costly, much like Korea and Vietnam were to Cold War-era Soviet containment. Alliances like NATO can’t take public support for granted, which means that its military operations and strategies need to be crafted accordingly. If NATO doctrine called for military confrontation in Afghanistan, it should have stopped short of a years-long occupation and nation-building mission.

The larger lesson here is that modern democracies can only sustain short wars. Therefore, military force should not be a last resort. It should be used early so that it doesn’t have to be used for long. If NATO has a future in the post-Iraq international order, it will be as a U.S.-led global expeditionary force that undertakes smaller, targeted missions, and does not consider military force a last resort but a necessary element of maintaining global stability. Whether the American people will tolerate such an alliance remains to be seen.