While President Obama was in Havana, where he worked to reestablish relations with a former adversary, an unexpected foreign policy debate emerged—not the longstanding hot-button issue of outreach to America’s enemies, but the subtler question of how America should handle its friends. For the first time in several decades, this year’s presidential foreign policy debate could go beyond when America should work with allies, asking whether they’re worth having at all. 

While the president was overseas, Donald Trump went on offense—only his target was not the Castro regime, Iran, or even North Korea. Instead, he took aim at Germany, Japan, and South Korea, core American allies for generations. Trump told The Washington Post that NATO may be “a good thing to have,” but it is “costing us a fortune.” As he reiterated to The New York Times editorial board, “Our country’s a poor country.” Asked by the Post whether America “gained anything” from having bases in East Asia, he said, “Personally, I don’t think so.” Later, Trump confirmed he would be willing to abandon Japan and other allies in East Asia unless they paid us more, and lamented, “We’re totally predictable, and predictable is bad.” 

It’s tempting not to take such remarks too seriously. But research by the Brookings Institution’s Thomas Wright suggests that Trump’s worldview has been remarkably consistent for over three decades. In Trump’s view, the very idea of alliances seems to be misconceived, a rip-off. Instead of making longstanding mutual security commitments to allies like South Korea or Germany, the U.S. should extract money from those it protects. It’s less a partnership between likeminded nations and more a protection racket in which smaller countries play the role of corner shops, and America plays the mobster collecting tribute and saying, “Nice country you’ve got here. Shame if something were to happen to it.”  

Even under the best of circumstances, alliances can be frustrating. The more powerful ally tends to chafe at the “free riding” and to make demands of smaller alliance partners. Smaller nations, for their part, fear abandonment and seek constant reassurance in terms of resources, rhetoric, and high-level attention. Each worries about being dragged recklessly into conflict by the other. Also, the military costs of maintaining alliances are measurable, while the savings of preventing conflict are abstract and indeed unknowable. 

That helps explain why just about every modern U.S. president has at some point voiced frustration with America’s alliances. Just recently President Obama told Jeffrey Goldberg of The Atlantic that “free riders aggravate me,” warning allies like the U.K. to contribute their fair share in order to maintain their special relationship with the U.S. It’s worth being clear on the differences: President Obama is not calling for walking away or abandoning America’s alliance commitments. But he is pointing to a larger concern that is likely to resonate with the American public: a sense that allies aren’t paying their fair share or doing their part to maintain global security. With the middle class under strain, wounds from the Iraq War still fresh, and the need for investment at home urgent, devoting U.S. resources to the security of other advanced nations can be a difficult sell.

From our founding and especially until the Second World War, Americans debated the merits of entangling alliances, and for most of our history chose to avoid them entirely. But since the Second World War, America’s leadership through Atlantic and Pacific alliances allowed the world to move beyond an era when global conflagrations claimed tens of millions of lives and into one of steadily increasing peace, prosperity, and democratic advances. For decades, Republicans and Democrats alike recognized that the unrivaled breadth and depth of our alliances, backstopped by U.S. preeminence, has kept large-scale global aggression in check. 

But today these benefits can seem abstract. And Donald Trump is ready to call them starkly into question. If America’s leaders cannot explain the value of its alliance partners, the nation could well step back toward a nineteenth-century conception of power rooted in nationalism and mercantilism that would leave us less safe and less prosperous. 

The case against America’s alliances, as articulated by Trump and others, rests on a few important misconceptions. 

First, America is not a “poor country,” as Trump asserts when he claims our allies are ripping us off. And we’re not in decline. On the contrary, we weathered a terrible global recession to create 14 million new private sector jobs since 2008, massively cut the deficit as a share of GDP, and became the world’s largest producer of oil and gas. We have major investments to make at home, from rebuilding our infrastructure to strengthening our social safety net. But we can afford to do both. It’s astounding to hear a candidate call for nearly $10 trillion in tax cuts, mostly for the rich, and then plead poverty when the bill comes due for a more secure world. Should America coax, cajole, and even arm-twist allies to do more? Absolutely. But we can afford to do our part as well.  

Second, the full value of America’s alliances cannot be assessed in purely transactional terms. It’s true that one measure of alliance value is burden-sharing. Many Americans know how quickly the “coalition of the willing” fell apart in Iraq. Fewer know, for example, that in Afghanistan over 1,000 allied forces gave their lives alongside U.S. and Afghan troops. 

But the value proposition of America’s alliances extends beyond how much South Korea compensates us to sustain our troop presence there, beyond whether Latvia spends 2 percent of its GDP on defense—even beyond who carries the painful burdens of war. Failing to see beyond the transactional is not hardheaded—it’s shortsighted. 

The value of our alliances is also about the wars they prevent by deterring aggression. They work because would-be aggressors know America will stand by its treaty allies, from jostling powers of Northeast Asia to the small Eastern European democracies that escaped the Iron Curtain. In other words, when it comes to commitments, we are “predictable.” In bargain-hunting, we shouldn’t lose track of that. 

In a world full of complex crises, alliances also play a catalyzing role in diplomacy— lowering the bar to collective action, providing readymade coalitions, giving us influence over other nations’ decisions, and legitimizing the actions we then take around the world. 

Another under-appreciated benefit of U.S. alliances has been their role in preventing the spread of nuclear weapons. In a region like Northeast Asia, without our security guarantees, scientifically advanced countries like Japan and South Korea would feel compelled to build their own nuclear arsenals and start an East Asian arms race. Why don’t they? Because they know America is committed to protecting them. To Trump’s credit, he was honest—if strangely cavalier—that his policies would likely spark a nuclear arms race in Northeast Asia. Likewise, Trump boasts about threatening Saudi Arabia over its wealth and Wahhabism, but overlooks that U.S. security guarantees against external threats are perhaps the single most important reason why the kingdom does not acquire a nuclear bomb of its own.  

And it’s not just the downside risks that make America’s alliances valuable. They are a unique attribute of America’s global leadership—a vision based not just on self-interest, but on a belief that international security and growth can create win-win outcomes. No other country—not China, not Russia—can boast a similar array of enduring friendships in every region on Earth. Other great powers wish they could create the same bonds—and they try, through Putin’s Eurasian Union or China’s Shanghai Cooperation Organization. But it’s not even close. And it shows in the difficulty these great powers have in finding support for their stances on contentious issues such as Crimea or the South China Sea. 

Effectively defending U.S. alliances requires being honest about their real shortcomings and working to make them better. The next U.S. president is likely to survey the problems of the world and seek more help than we’re currently getting. And in many cases the structures in place will not be up to the challenge, from European intelligence services’ ability to track foreign fighters who would target Americans, to NATO members’ defense spending as a share of GDP, to enduring suspicion between key East Asian allies like Japan and South Korea, to mutual frustrations with traditional Arab Gulf partners. 

How to get the most from our allies and partners is a longstanding question and never-ending challenge. But to have the likely presidential nominee of a major party fundamentally questioning the basic value of these alliances is new. In diplomacy, as in a business transaction, the willingness to walk away can be an important point of leverage. But our most important alliances function best on firmer footing.  

Donald Trump’s views on alliances are dangerous in part because they tap into real frustrations and offer temptingly simple solutions. To some, it might be emotionally satisfying to go alliance by alliance and threaten to walk away unless you get exactly what you want. The problem is that precipitating crises in all of America’s alliances at once would also do serious damage to decades of work by several American presidents to build our credibility around the world. We do need to use our leverage to elicit a greater effort from others. But when our friends and partners can’t rely on us—as Donald Trump specifically says they shouldn’t—that saps our influence and injects new risk into an already too volatile world. 

Alliances are part of what keeps America great. Systematically threatening them would make the world more dangerous, and that would be no bargain at all.