Donald Trump owes his victory in the Electoral College to three states he won by the smallest number of votes: Pennsylvania, Wisconsin, and Michigan. So it's fair to say that the 2016 presidential election was decided by about 77,000 votes out of than 136 million ballots cast. According to the final tallies, Trump won Pennsylvania by 0.7 percentage points (44,292 votes), Wisconsin by 0.7 points (22,748 votes), Michigan by 0.2 points (10,704 votes). If Clinton had won all three states, she would have won the Electoral College 278 to 260. She fell short in all three, of course, and that's why we are now getting accustomed to the reality of President-elect Donald J. Trump. (This article has been updated to reflect final results.)

Trump's victory in these three states was a big shift from 2012, when Obama won Michigan by 9.5 points, Wisconsin by 6.7 points, and Pennsylvania by 5.2 points. Although the national vote swung only about 3 points toward GOP in 2016 (leaving Hillary Clinton as the narrow winner of the popular vote), these three states swung by 6 to 10 points toward the Republican presidential nominee.

So what accounts for the swing? A close look at the exit polls reveals a slightly different story in each state, but most of the change is due to the fact that Clinton performed much worse than Obama did among middle- and low-income voters.

In Pennsylvania, overall turnout was up from 2012 (from 5.6 million to 6 million), but the racial composition of the electorate was significantly different. Clinton won 92 percent of African-Americans and Obama won 93 percent of African-Americans. But in 2012, black voters made up 13 percent of the electorate; in 2016, they comprised just 10 percent of the electorate.

In terms of raw votes, that means roughly 130,000 fewer African-Americans voted in Pennsylvania in 2016 than voted in 2012. If those voters had shown up on Tuesday, that alone would've been enough for Clinton to hold Pennsylvania by a razor-thin margin.

Clinton lost white voters by 16 points (40 percent to 56 percent); in 2012, Obama lost white Pennsylvania voters by 15 points (42 percent to 57 percent). But white voters accounted for 81 percent of of the 2016 electorate and 78 percent of the 2012 electorate.

The big shift in Pennsylvania occurred among to lower- and middle-income voters. Among those earning less than $50,000, Clinton won by 12 points (54 percent to 42 percent); in 2012, Obama won this group by 36 points (67 percent to 31 percent). Clinton and Obama won the same percentage of voters earning between $50,000 and $100,000 (41 percent) and the same percentage of those earning more than $100,000 (45 percent).

In Wisconsin, turnout was down slightly (from 3.06 million in 2012 to 2.95 million in 2016), but the racial composition of the electorate was the same, according to the exit polls: 86 percent white, 7 percent black, and 4 percent Latino.

In the last two presidential elections in Wisconsin, the Democrat won almost the same percentage of black voters (94 percent in 2012 and 92 percent in 2016). But Clinton lost white Wisconsin voters by 11 points (42 percent to 53 percent), whereas Obama lost white voters by only 3 points in 2012 (48 to 51).

The biggest swing was among voters earning less than $50,000. Clinton won that group by 4 points (49 percent to 45 percent); Obama won that group by 25 points (62 percent to 37 percent). Clinton lost those earning $50,000 to $100,000 by 6 points, but Obama lost them by just 1 point.

There was also a big swing among Wisconsin voters earning $100,000 or more: Clinton edged out Trump among this group by 2 points (48 percent to 46 percent), but Obama lost that group by 20 points in 2012 (39 percent to 59 percent).

In Michigan, turnout was only up slightly (from 4.72 million to 4.79 million ballots cast). The white share of the electorate shrunk from 77 percent to 75 percent, while the black share was down from 16 percent to 15 percent, and the Latino share was up from 3 percent to 5 percent. Obama and Clinton won close to the same percentage of minority voters, but Clinton lost white voters by 21 points; Obama lost them by 11 points.

The big shift, again, came among voters earning less than $50,000. (Median household income is $49,000 in Michigan and about $53,000 in Wisconsin and Pennsylvania).

Clinton won Michiganders earning less than $50,000 by 11 points (53 percent to 42 percent); Obama won them 26 points (62 to 36 percent). Obama lost those earning $50,000 to $100,000 by 1 point (49 percent to 50 percent); Clinton lost them by 8 points (43 percent to 51 percent). Among those earning $100,000 or more, Clinton lost by 8 points (43 percent to 51 percent); Obama lost them by 4 points (48 percent to 52 percent).

As the election results sink in, anyone who wants to attribute Trump's victory to racism will need to account for the fact that it was white Obama voters who provided Trump with his margin of victory in the three states that decided the election.

Correction (3:45p.m.): This post initially misstated Trump's performance among white Pennsylvania voters.