Donald Trump talks tough. “We’re going to win on trade,” he told a crowd in Windham, New Hampshire, on Saturday night. “We’re going to win with the military. We’re going to kick the ass of ISIS.”

But Trump has a soft spot. He speaks reverently of Russia’s strongman president, Vladimir Putin. He defends Putin’s seizure of Crimea, a Ukrainian territory. He refuses to criticize Russia’s alleged role in the hacking of the Democratic National Committee. Last month, Trump’s representatives apparently softened Republican platform language that would have called for military assistance to Ukraine.

Why does Trump suck up to Russia? In part, it’s because Putin flatters Trump, and Trump is openly smitten by the flattery. In part, it’s because Trump has pro-Russian advisers. Trump might also be influenced by his financial ties to Russia, which Slate’s Franklin Foer has documented. But those explanations still leave a puzzle: How does a man who preaches vigilance and “American First” become another country’s tool? What makes Trump kick one ass but kiss another?

The answer lies in a peculiar mix of ideas and dispositions: Trump’s nationalism, his authoritarianism, his disregard for the laws of war, and his belief that foreign policy can be conducted like a business. But the factor that unites them all is the complexity of international relations. You’re never dealing with just one country. If you aim your vigilance in one direction, you can be fleeced or used from the other direction. That’s what has happened to Trump. In case after case, he has vowed to stand up to leaders, countries, and nonstate actors that happen, by coincidence or design, to be Russia’s adversaries.

In his speeches, Trump describes a litany of enemies: Iranian mullahs, Syrian refugees, Mexican rapists, Chinese trade negotiators. None of these putative threats is fundamentally allied with Russia. And Trump isn’t wrong that in the struggle against Islamic jihadism, Russia’s interests often overlap with ours. At rallies in recent days, Trump has recited a list of terrorists and terror suspects from Afghanistan, Kyrgyzstan, and Uzbekistan, countries that have given Russia fits.

Trump is quite open in his overtures to Putin. “Wouldn’t it be nice if we actually did get along with Russia?” Trump asked an audience in North Carolina on July 25. “Wouldn’t it be nice if Russia and us and a couple of others went out and knocked the hell out of ISIS?” Fighting ISIS was too expensive for Russia or for us alone, Trump argued. Why not split the cost? It’s “no different than a business,” he said.

President Obama doesn’t see war this way. Obama’s problem, in Trump’s view, is that he won’t stand for the way Russia and its Syrian proxies fight, because they endanger and kill civilians. Trump has no such compunctions. He’s for torture, targeting the families of terrorists, and loosening the rules of engagement. He also says we should seize Iraq’s oil because “to the victor belong the spoils.” Trump’s military ethics are no different from Putin’s. Teaming up with Russia makes sense.

The same business logic explains Trump’s withdrawal of America’s commitment to defend Europe. Traditionally, American presidents have treated Russia as a threat because of its aggression around the world, but particularly in Europe. Putin’s seizure of Crimea in 2014 and his ongoing proxy war in Ukraine provide fresh evidence of this threat. But Trump doesn’t choose to confront Russia. He chooses to confront the countries Russia might invade, by insisting that they pay us more to protect them.

At several recent campaign rallies, Trump has delivered a clear message: If NATO members don’t meet his financial demands, the United States, on his watch, would not defend those countries in the event of a Russian invasion, regardless of treaty commitments. “I want the countries that we’re protecting to pay up,” Trump told a crowd in Harrisburg, Pennsylvania, on Aug. 1. “And if they don’t, I’m sorry, folks.” Two days later, speaking in Jacksonville, Florida, Trump noted that reporters had asked him, “What happens if one of these countries … gets attacked by Russia? Are you saying you’re not going to protect them?” His response, he proudly told the audience, was: “Well, let me ask you: Have they paid?”

For Trump, it’s all about money. Many of the countries we defend, he points out, are wealthy. His list starts with Germany, Japan, South Korea, and Saudi Arabia. “If Japan is attacked, we have to go in there with our full force and might,” he complained in Green Bay, Wisconsin, on Friday. If the Japanese don’t pony up, he warned, they might have to “take over this monster [North Korea] and figure it out. We’re very far away. It’s very expensive.”

Many of the countries we defend don’t have Japan’s wealth. So Trump offers a different argument for not coming to their aid: They’re unimportant. How does Trump measure geostrategic importance? The same way he measures everything else: by ratings. “We’re protecting countries that most of the people in this room have never even heard of,” he jeered at a rally in Scranton, Pennsylvania, on July 27. “Give me a break.”

NATO’s founding purpose is to send a clear message that if any member is attacked, others stand ready to defend it by force. Trump rejects that policy, preferring unpredictability to deterrence. In a Fox News interview with Trump on July 30, Brian Kilmeade pointed out that Russia had invaded two neighboring countries, Georgia and Ukraine, and had buzzed American ships. If Russia were to escalate its military incursions, Kilmeade asked, “Would you answer with force?” In his reply, Trump chose not to warn Russia, even vaguely, that it would pay a price. “I’m not going to tell you,” he told Kilmeade. “You’ve got to keep it a little bit secret.”

Trump doesn’t just flash a green light to Russia. He directly undermines NATO and advances Russia’s ambitions by encouraging Europe to break up. Putin views the dissolution of the Soviet Union as a catastrophe. To even things out, the Russian president has been promoting nationalism in Europe, with the goal of fracturing the European Union and NATO. In this effort, Trump has become Putin’s ally, celebrating Britain’s exit from the EU and urging other European countries to follow suit.

British voters ditched the EU because “they’ve had enough,” Trump told a crowd in Ashburn, Virginia, on Tuesday. Having left, he argued, “They’re better off. And you watch: Other countries in the European Union will follow. … You watch what happens to Angela Merkel.” Trump went on: “People now tell me they’re going to leave Germany.” In speech after speech, he adds: “France is no longer France.”

Alongside this portrait of Europe in decline, Trump depicts an ascendant Russia. He says Hillary Clinton is a fool to mess with Putin’s might. “She has terrible relationships with Putin,” Trump told the audience in Virginia. “This is a nuclear country we’re talking about. Russia, strong nuclear country. And so are we, but their stuff is newer. Their stuff is newer … [and] they have a lot more.” Clinton “wants to play the role of the tough guy against Putin and Russia,” Trump scoffed. Instead, he argued, “She should be tough on trade,” particularly “our trade deficits with China.”

Trump points out that Russia and China are collaborating on some things, including oil sales and naval exercises. For this, he blames Obama. “We forced [Russia], through stupidity, into an alliance with China,” Trump charged in Columbus, Ohio, on Aug. 1. “We were driving them both crazy. … Obama forced them together, ’cause he didn’t get along with either.” That’s what you get when you stand up to Putin, says Trump. Putin holds the cards, and we had better stop giving him trouble.

Given a choice between America’s president and Russia’s, Trump prefers Russia’s. “He’s a better leader than Obama,” Trump says. Even when interviewers point out that Putin, unlike Obama, arranges the murders of his domestic opponents, including journalists, Trump still says Putin is better. That’s because Trump, like Putin, believes in “law and order” without irksome constitutional constraints.

And that’s why Trump, in the face of intelligence assessments that Russian agents hacked the Democratic National Committee, celebrates the hack and refuses to criticize Russia for it. Trump says he was joking when he proposed, at a press conference on July 27, “Russia, if you’re listening, I hope you’re able to find the 30,000 emails that are missing.” But that doesn’t explain why, when reporters invited Trump to “call on Putin to stay out of this election,” Trump shot back: “I’m not going to tell Putin what to do. Why should I tell Putin what to do?” Trump said he agreed with Putin that American incompetence, not Russian espionage, was to blame for the hack. The real story, Trump argued, was the content of the leaked emails, not “Russia or China or whoever it is that’s doing the hacking.”

This is the final ingredient in Trump’s bromance with Putin: For Trump, sucking up to Putin is a way of standing up to Obama and Clinton. The Republican nominee’s antipathy toward the Democratic president and the former Democratic secretary of state is so great that when Russia commits espionage against them, Trump sides with Russia. To Trump, this isn’t a show of disloyalty or gullibility. It’s a show of firmness against America’s real enemy: Clinton. On Saturday, speaking in New Hampshire, Trump called her a “monster” who would cause “the destruction of our country from within.”

That’s how, in the name of a muscular America, you become a Russian tool. You despise America’s president. You admire strength and disdain constitutional limits on it. You glorify nationalism at the expense of alliances. You treat foreign policy as a business, choosing partners based on profit, not on shared values. And all the while, as you aim your scrutiny and threats at the enemies of a single foreign power, you tell yourself and the public that you’re a hawk. You’re not a hawk. You’re a pigeon.

Read more Slate coverage of the 2016 campaign.