Once upon a time, liberals criticized Barack Obama for only taking on fights he knew he could win. Not anymore. In 2013, Obama responded to the Sandy Hook shooting with a fervent, if unsuccessful, push for gun control. Now, over the past week, he’s met the nativist hysteria sparked by the attacks in Paris with an impassioned, enraged rhetorical barrage on behalf of the admission of Syrian refugees. He’s done so even though polls show that a clear majority of Americans now oppose admitting any Syrians. And even though, last Thursday, 47 House Democrats broke with him to help overwhelmingly pass a bill that would make admission of Syrian refugees virtually impossible.

Nonetheless, Obama has been unyielding. Last Monday from Turkey he went after Ted Cruz, declaring that, “When I hear political leaders suggesting that there would be a religious test for which person who’s fleeing from a war-torn country is admitted when some of those folks themselves come from families who benefitted from protection when they were fleeing political persecution, that’s shameful. That’s not American.” On Tuesday in the Philippines, Obama targeted Chris Christie for being “worried about three-year-old orphans. That doesn’t sound very tough to me.” On Wednesday he fired off six straight tweets on the subject, the last of which declared that, “Slamming the door in the face of refugees would betray our deepest values. That’s not who we are. And it’s not what we're going to do.” Then, after meeting refugee children on Saturday in Malaysia, he declared that, “American leadership is us caring about people who have been forgotten or who have been discriminated against or who’ve been tortured or who’ve been subject to unspeakable violence or who’ve been separated from families at very young ages. That’s when we’re the shining light on the hill.”

Why is Obama picking a fight on an issue that, according to The Washington Post’s Chris Cillizza, is a “political winner” for the GOP?

Because of the way he interprets American history.

Every president tells the story of America’s past to justify the policies he’s pursuing in the present. For George W. Bush, the story was about America being roused from its complacency by external danger. In 1999, then candidate Bush quoted Winston Churchill as declaring, in the late 1930s, that “the era of procrastination, of half measures-of soothing and baffling expedients, of delays, is coming to a close.” Then, in his second inaugural, Bush described his own era as “years of relative quiet, years of repose, years of sabbatical” followed by “a day of fire.” The implication was that to fulfill his role in history, Bush needed to rally Americans against the evil that lurked beyond their shores.

Obama tells the story of American history differently: as America overcoming the evil within itself. In his 2008 Democratic convention speech, he talked about “a promise that has led immigrants to cross oceans and pioneers to travel west, a promise that led workers to picket lines and women to reach for the ballot.” The first two references—to immigrants escaping foreign oppression and pioneers overcoming nature’s hardships—are standard political fare. But by twinning them with workers battling exploitation and women battling sexism, Obama suggested that external and physical forces aren’t the only barriers to American progress. Sometimes, the barriers are other Americans.

It’s a theme that recurs in Obama’s speeches. In his first inaugural, he said America’s “greatness” resided in those Americans who “traveled across oceans in search of a new life ... settled the West ... and plowed the hard earth” but also those who “toiled in sweatshops and endured the lash of the whip.” In other words, America achieved greatness because Americans seeking dignity and freedom triumphed over Americans who sought to deny them those things. In Obama’s second inaugural he talked about the “star that guides us” toward full equality, “just as it guided our forebears through Seneca Falls, and Selma, and Stonewall.” This March, on the 50th anniversary of the march from Selma to Montgomery, he said what occurred there was “a clash of wills; a contest to determine the true meaning of America.”

Obviously, Obama knows America faces enemies abroad. But unlike Bush, who took World War II and the Cold War as his precedents for the “war on terror” and thus cast America as a virtuous nation menaced by foreign malevolence, Obama refers frequently to America’s malevolence within. He sees American history as a series of moral struggles pitting Americans seeking equal opportunity and full citizenship against Americans who defend an unjust or bigoted status quo.

Obama clearly sees the current nativist, bigotry-laden, hysteria as such a struggle. He knows he may not win. But he wants future historians to know exactly where he stood. They will. And as a result, I suspect, they’ll record the Syrian refugee battle among his finest hours.