President Barack Obama met with President-elect Donald Trump Thursday in the Oval Office.

It goes without saying that Trump has not been a big fan Obama’s. Trump entered politics by fixating on a racist conspiracy theory that the president was not a US citizen, and has recently said he only relented because of his own campaign and refused to apologize. Trump railed against Obama as “incompetent” and “a feckless leader.”

Thursday afternoon, he changed his tune, calling Obama “a very good man.”

Trump might owe Obama not just a compliment, but a “thank you,” too. After all, there’s an argument to be made that the racial backlash against the first black president set the stage for Trump’s message to resonate, and for him to win the presidency.

But how could many of those who elected Obama in the first place then allow their racial anxiety to guide their votes eight years later? According to two experts, it’s because Obama himself, standing in for a much larger set of issues, triggered a powerful set of reactions — powerful enough to, with Trump’s encouragement, decide an election.

Obama became a proxy for issues much bigger than himself

Eddie Glaude, chair of Princeton University’s Center for African American Studies, said he observed a marked difference between the climate of this election versus Obama’s 2008 election, and even his reelection in 2012.

“There was the 2008 election,” he said, “which made everyone feel good and declare that we were post-racial and the like, and there was kind of interesting cross-racial joy even though there was an undertone of dismay.”

The 2012 election, though, was all “racial anxiety and anguish,” Glaude continued. “It was the first time a president was elected without a majority of white people voting for him. It heralded the demographic revolution in some ways. People had been talking about a majority-minority nation, but you combine that with data that for the first time there were more brown babies than white, Obama became a kind of proxy for this kind of anxiety about the changing nature of the country.”

Glaude added that Obama also came to embody, in the minds of voters, the conservative critique of the problems with government — namely, that it is too big and does too much. But he said Obama’s race made this criticism stick.

“People say it’s not about race, it’s about the failure of government. But the belief in the failure of government is really about the belief that the government is engaged in the redistribution of wealth from those who deserve, to those who don’t deserve,” he said. “Obama is a black embodiment of the racial undercurrent of the critique of big government, even though when you look at who he is and how he's governed he doesn’t fit the bill.”

When people are dealing in emotional reactions and deeply held stereotypes, Glaude said, “it doesn’t matter who is right in front of them.”

According to his reading of the past eight years, all of this combined to create an environment that meant white voters were primed to let their views on race drive this election — even if they thought of them consciously as critiques of government. And Trump was able to take advantage of that, especially with Clinton symbolizing the extension of an Obama administration.

Trump seized upon Obama-inspired racial anxiety — and won

Michael Tesler, an assistant professor of political science at University of California Irvine, researches political psychology, racial politics, and political communications. Here, he explains how the mere existence of a black president prompted white voters to lash back by voting for Trump, party affiliation not withstanding:

My book, Post-Racial or Most-Racial: [Race and politics in the Age of Obama], shows that Obama's presidency rapidly accelerated the pre-existing relationship between party identification and racial attitudes. Moreover, he activated a previously non-existent partisan divide according to attitudes about Muslims — one that contributes to partisan sorting even after controlling for racial attitudes. The book further shows that most of this growing polarization of party identification was driven by non-college educated whites. Prior to Obama's presidency, racial attitudes were only weakly related to party identification among non-college whites, but that correlation shot through the roof during Obama's presidency.

Given that party identification drives elections, and that party is now more about racial attitudes than ever, it’s easy to say this election was more about race than Obama’s last two elections were, he said. But even controlling for that party identification/racial resentment link, Tesler says his preliminary research shows that racial attitudes mattered more in 2016 than in either 2008 or 2012.

How could that be, given Obama's race? many would ask. “Well, one of the things that made Obama-era racialization so extraordinary is that it was mostly a reaction to who the president was, rather than what he did,” Tesler said. “Dan Gillion's great new book shows that Obama talked about race less than prior Democratic presidents and did a strong push for race-specific policies.”

Enter Trump, who made explicit racial appeals — about Mexican immigrants, Muslims (who, although they aren’t a racial group, are widely conceived of and treated as such in America), and black people — in a way no modern Republican candidate had. At the same time, said Tesler, Hillary Clinton campaigned further to the left on race and ethnicity than any other nominee in generations.

The result: “Obama-era racialization, plus Trump’s explicit appeals, plus Democrats tracking left on race, equals a greater influence of racial attitudes than ever.” And a new president with an unlikely person to thank.