The conventional wisdom after 2012 held that Mr. Obama was a historically weak candidate among white working-class voters, and that there wasn’t much room for the Republicans to make additional gains. To the extent that there was an argument for how Republicans could make big gains among the group, it was that they could rally the support of missing white voters — a group that in reality appears more Democratic than the white voters who do turn out in elections.

But exit polls tend to undercount the number of less educated voters, and the national exit polls obscured Mr. Obama’s strength among white voters in the North. They showed him faring worse among white voters than any Democrat since Walter Mondale, but that was exclusively because of his weakness in the South. In many Northern states — like Iowa and Ohio — Mr. Obama did better among white voters than past Democrats. There was a lot of room for Mrs. Clinton to fall. She’s proving it.

For many, it was very hard to imagine that Mrs. Clinton — a white Democrat who excelled among white working-class voters in the 2008 Democratic primary — could lose voters who supported Mr. Obama in the 2012 election, or who approve of his performance today. It’s even stranger if one believes that racism is at the core of Mr. Trump’s appeal: If Mr. Trump’s supporters are animated by racism, then why did so many of them vote for Mr. Obama?

Racism might well animate Mr. Trump’s base. But his appeal among some white Obama supporters suggests that Mr. Trump and Mr. Obama might have something in common.

Mr. Trump has changed the story lines of the 2012 and 2008 elections — and tapped into many of the same issues and frames that helped Mr. Obama.

In 2008, Mr. Obama depicted himself as an agent of hope and change: He ran against Washington, the establishment and special interests. In 2012, the Obama campaign attacked its Republican opponent, Mitt Romney, as a plutocrat who would outsource jobs and help the wealthy, not the middle class.

Those are the kinds of reasons that white working-class Democrats in places like Scranton, Pa., and Youngstown, Ohio, remained with the Democrats.