The scene at Donald Trump’s election night event at the New York Hilton Midtown.
Donald J. Trump won the presidency by riding an enormous wave of support among white working-class voters.
It was always a possibility, but it had looked highly unlikely. Hillary Clinton led in nearly every national poll — and in other surveys in the states worth the requisite 270 electoral votes.
The traditional view of recent American elections gave even more reason to think Mrs. Clinton was safe. National exit polls suggested that President Obama won the 2012 presidential election despite faring worse among white voters than any Democrat since Walter Mondale. Those polls showed that white voters without a degree were now just one-third of the electorate. It was interpreted to mean that there was not much room for additional losses, especially once a white Democrat replaced Mr. Obama on the ballot.
The truth was that Democrats were far more dependent on white working-class voters than many believed.
In the end, the bastions of industrial-era Democratic strength among white working-class voters fell to Mr. Trump. So did many of the areas where Mr. Obama fared best in 2008 and 2012. In the end, the linchpin of Mr. Obama’s winning coalition broke hard to the Republicans.
The Wyoming River Valley of Pennsylvania — which includes Scranton and Wilkes-Barre — voted for Mr. Trump. It had voted for Mr. Obama by double digits.
Youngstown, Ohio, where Mr. Obama won by more than 20 points in 2012, was basically a draw. Mr. Trump swept the string of traditionally Democratic and old industrial towns along Lake Erie. Counties that supported Mr. Obama in 2012 voted for Mr. Trump by 20 points.
The rural countryside of the North swung overwhelmingly to Mr. Trump. Most obvious was Iowa, where Mr. Obama won easily in 2012 but Mr. Trump prevailed easily. These gains extended east, across Wisconsin and Michigan to New England. Mr. Trump won Maine’s Second Congressional District by 12 points; Mr. Obama had won it by eight points.
These gains went far beyond what many believed was possible. But Mr. Obama was strong among white working-class Northerners, and that meant there was a lot of room for a Democrat to fall.
That fact was obscured by national exit polls that showed Mr. Obama faring worse among white voters than any Democratic nominee since 1984. But Mr. Obama fared very poorly only among white voters in the South. He ran well ahead of Mrs. Clinton just about everywhere else.
The exit polls also systematically underestimated the importance of these white working-class voters to Democrats. In general, they overestimated the number of well-educated and nonwhite voters.
The result was that many postelection analysts underestimated the number of white working-class voters over age 45 by around 10 million.
Despite all this, Mrs. Clinton was still considered a clear favorite heading into the election. The polls showed her ahead nationwide by around four points. She was ahead in virtually all of the polls in the Midwestern states that cost her the election.
But Mrs. Clinton’s lead was not unassailable. The Upshot’s model gave Mr. Trump a 15 percent chance of winning the election.
Mrs. Clinton’s odds were about the same as making a 37-yard field goal in an N.F.L. game. For some, that will not seem an appropriate acknowledgment of the uncertainty. But the point is that field-goal kickers frequently miss 37-yard field goals. It is also not especially uncommon for the polls to miss a three- or four-point race.
And it is not as though the pollsters hadn’t missed a field goal in a long time. The polls underestimated the Republicans in the 2014 midterms; they underestimated the Democrats in 2012; and abroad they were off by a modest but comparable amount on the Brexit vote.
In this election, the polls will not end up being off by very much nationally. Indeed, Mrs. Clinton will almost certainly carry the popular vote — by at least one percentage point. The national polls gave Mrs. Clinton a four-point lead in the final stretch; the final New York Times/CBS News poll had Mrs. Clinton up by three.
Taken in totality, Mrs. Clinton probably did win Hispanic voters by a big margin, as pre-election polls predicted. She probably did make big gains among white voters with a college degree — though it’s unclear whether she won them.
But the polls were wrong about one big thing: They missed Mrs. Clinton’s margin in the Midwestern states, like Wisconsin, Michigan and Pennsylvania.
The exact mechanism for the error is unclear. Perhaps undecided voters broke for Mr. Trump; maybe there really were “silent” voters for him, people who were reluctant to tell pollsters that they backed him. Perhaps it took a lot breaking Mr. Trump’s way: Maybe Republican voters came home to the party over the last week in well-educated suburbs, while undecided white working-class voters broke for Mr. Trump.
But what’s clear is that the error wasn’t simply about the public polls. The Clinton campaign, which ran its own polls, was convinced it was on track to victory. It barely even aired advertisements in Wisconsin, Minnesota and Michigan.
In the end, many of the factors that made Mrs. Clinton appear favored to win in these states simply weren’t there. Nor did she win heavily Hispanic counties in Florida by the wide margins that many expected — only slightly outperforming Mr. Obama in Miami-Dade County and the Orlando-Kissimmee area, even as she outperformed in Texas and California. And she didn’t overperform in the Philadelphia area, even as she posted huge margins in the Chicago area and Seattle.
Whatever gains she made among well-educated and Hispanic voters nationwide either didn’t occur to the same extent in the key battlegrounds, or were overwhelmed by Mr. Trump’s huge appeal to white voters without a degree.