On Friday night, Donald Trump fulfilled one of his signature campaign promises: He issued an executive order banning Syrian refugees from entering the United States, indefinitely.

Ostensibly, this policy is supposed to lower the threat level from terrorist groups operating in Syria, most notably ISIS. But the opposite is true: This kind of vicious, cruel policy plays right into ISIS's hands.

ISIS despises Syrian refugees: It sees them as traitors to the caliphate. By leaving, they turn their back on the caliphate. ISIS depicts its territory as a paradise, and fleeing refugees expose that as a lie. But if refugees do make it out, ISIS wants them to be treated badly — the more the West treats them with suspicion and fear, the more it supports ISIS's narrative of a West that is hostile to Muslims and bolsters ISIS's efforts to recruit from migrant communities in Europe.

The fewer refugees the West lets in, and the chillier their welcome on arrival, the better for ISIS.

Why ISIS hates Syrian refugees

The flight of refugees from Syria "makes them look bad," Daveed Gartenstein-Ross, a senior fellow at the Foundation for the Defense of Democracies, told me in 2015.

Refugee flight from Syria "undermines IS’ message that its self-styled Caliphate is a refuge," Aaron Zelin, a fellow at the Washington Institute for Near East Policy, writes on the site Jihadology. "If it was [a refuge as they claim], individuals would actually go there in droves since it’s so close instead of 100,000s of people risking their lives through arduous journeys that could lead to death en route to Europe."

To demonstrate his point, Zelin looked through a number of ISIS's public statements on the refugee crisis. ISIS speakers "warn that the ‘Jews and Christians’ do not have their interests at heart, and will force them to convert in order to remain in their countries," he found. "They assert that the Islamic State will remain strong despite those leaving. [Refugees] will find happiness only in the land of the caliphate."

If mass refugee flows really were a useful way for ISIS to sneak operatives into Europe, the group almost certainly wouldn't be saying these things. It's "unlikely that the vast majority of Syrians fleeing to Europe are ISIS supporters," Patrick Kingsley, the Guardian's migration correspondent, writes. "Their actions are in obvious contravention of the group’s creed."

In reality, Syrian refugees are fleeing conflict, seeking only a secure and stable life. Many of the men are fleeing the threat of conscription into Bashar al-Assad's army. They don't want to fight for anyone, let alone ISIS.

"For those who want to blame the attacks on Paris on refugees," Zelin wrote after the 2015 terror attacks in France, "you might want to get your facts straight."

How ISIS benefits from refugee suffering

Once refugees flee, however, ISIS hopes that they're denied entry and mistreated. "A backlash against the refugee population," Gartenstein-Ross explained, "serves their interests in a number of ways."

Core to ISIS's narrative is that the struggle between the West and Islam is fundamental: that the United States and Europe are, and forever will be, at war with Islam and thus all Muslims. This argument has been brilliantly successful, helping persuade thousands of disaffected European youth to leave their homes to fight for ISIS in Syria and Iraq.

When refugees are stuck in refugee camps — or, better yet, turned away from the most powerful country in the West entirely. Trump's policy helps to make ISIS's point for them, giving the impression, rightly or wrongly, that the West really is hostile to Muslims.

ISIS's attacks in the West, whether by design or not, could thus serve the group by deepening the backlash against refugees.

"Having this wedge driven, where [ISIS] is able to intensify the backlash against refugees might help with recruiting efforts by extremists to recruit among the refugee population," Gartenstein-Ross explained.

"Game it out from their perspective," he continued. "If they were able to move operatives into Europe, posing as migrants and refugees, then that's a major win for them," both as an act of terror and to increase anti-refugee sentiment in Europe.

Welcoming immigrants, in other words, isn't just a moral act — it's smart counterterrorism.