In May, I visited Vietnam and met with university students. After a week of being love-bombed by Vietnamese, who told me how much they admire America, want to work or study there and have friends and family living there, I couldn’t help but ask myself: “How did we get this country so wrong? How did we end up in a war with Vietnam that cost so many lives and drove them into the arms of their most hated enemy, China?”

It’s a long, complicated story, I know, but a big part of it was failing to understand that the core political drama of Vietnam was an indigenous nationalist struggle against colonial rule — not the embrace of global communism, the interpretation we imposed on it.

The North Vietnamese were both communists and nationalists — and still are. But the key reason we failed in Vietnam was that the communists managed to harness the Vietnamese nationalist narrative much more effectively than our South Vietnamese allies, who were too often seen as corrupt or illegitimate. The North Vietnamese managed to win (with the help of brutal coercion) more Vietnamese support not because most Vietnamese bought into Marx and Lenin, but because Ho Chi Minh and his communist comrades were perceived to be the more authentic nationalists.

I believe something loosely akin to this is afoot in Iraq. The Islamic State, or ISIS, with its small core of jihadists, was able to seize so much non-jihadist Sunni territory in Syria and Iraq almost overnight — not because most Iraqi and Syrian Sunnis suddenly bought into the Islamist narrative of ISIS’s self-appointed caliph. Most Iraqi and Syrian Sunnis don’t want to marry off their daughters to a bearded Chechen fanatic, and more than a few of them pray five times a day and like to wash it down with a good Scotch. They have embraced or resigned themselves to ISIS because they were systematically abused by the pro-Shiite, pro-Iranian regime of Bashar al-Assad in Syria and Prime Minister Nuri Kamal al-Maliki in Iraq — and because they see ISIS as a vehicle to revive Sunni nationalism and end Shiite oppression.