In the aftermath of the 2016 presidential election, many analysts suggested that Hillary Clinton lost to Donald J. Trump because of poor Democratic turnout.

Months later, it is clear that the turnout was only modestly better for Mr. Trump than expected.

To the extent Democratic turnout was weak, it was mainly among black voters. Even there, the scale of Democratic weakness has been exaggerated.

Instead, it’s clear that large numbers of white, working-class voters shifted from the Democrats to Mr. Trump. Over all, almost one in four of President Obama’s 2012 white working-class supporters defected from the Democrats in 2016, either supporting Mr. Trump or voting for a third-party candidate.

This analysis compares official voter files — data not available until months after the election — with The Upshot’s pre-election turnout projections in Florida, Pennsylvania and North Carolina. The turnout patterns evident in these states are representative of broader trends throughout the battleground states and nationwide.