If Hillary Clinton had won the presidency — and she took the popular vote by nearly 3 million — the narrative of the 2016 election would be far different. Rather than the storyline being Donald’s Trump triumph in the heartland, with its beleaguered blue-collar workers, the emphasis now would be on the Democrats’ ongoing success in metro America, with its large share of the nation’s growing minority population. The conventional wisdom would surely be that the Democrats were likely to control the White House for years to come.

That still might happen, and the 2016 presidential election may ultimately be viewed as an aberration that will be difficult for the Republicans to replicate. As it was, the election was a split decision — Clinton taking the popular vote, Trump the all-important electoral vote.

In the process, both candidates played to their party’s strengths, with an important caveat or two that made the 2016 election both different and noteworthy.

Clinton rolled up the vote in traditional Democratic bastions: major urban centers, high-tech areas, academic communities, minority strongholds (African American and Hispanic, in particular), and state capitals with their sizable government workforces. But she also extended the Democrats’ recent success in the suburbs, long a competitive sector of the electorate.

Trump, for his part, scored big in the usual Republican preserves: rural and small-town America, retirement communities, heavily white counties, and those with military installations. He also made important inroads in historically Democratic industrial areas. Among the counties that he drew into the Republican column were Macomb County (MI), Luzerne County (PA), and Kenosha County (WI).

Macomb County, where reporters often go in search of blue-collar “Reagan Democrats,” has become a national bellwether of sorts, voting for Obama both times he ran for president and Republican George W. Bush in 2004. In contrast, Luzerne County had not bolted from the Democrats since 1988, nor Kenosha County since Richard Nixon trampled George McGovern in 1972. All three counties, plus a number of other blue-collar ones that Trump carried, were critical to his cracking the Democrats’ supposedly impregnable “blue wall” in Michigan, Pennsylvania, and Wisconsin.

As for Clinton, she pushed the Democrats’ reach deeper into suburbia, flipping such counties as Cobb and Gwinnett outside Atlanta, Chester outside Philadelphia, and Orange in southern California from the Republican side in 2012 to the Democratic column in 2016.

Pennsylvania’s Chester County had voted for Barack Obama in 2008. But Cobb and Gwinnett counties had not voted for a Democrat since 1976, when Georgian Jimmy Carter first ran for president. And Orange County, the quintessential home of Sun Belt conservatism, last voted Democratic for president in 1936, at the height of Franklin D. Roosevelt’s New Deal.

Antipathy to Trump was no doubt a factor in the Democrats’ success in the suburbs, but so was a growing minority population in many of these counties. Orange County, for instance, which was barely 20% minority in 1980, was majority-minority by 2010.

Yet there was also a feast or famine quality to the Clinton and Trump votes. Many counties in rural America did not give Clinton even 25% of the vote, and sometimes far less than that. It helped to make her beatable in states that she was counting on winning.

On the other hand, in a number of the country’s major urban centers, Trump quite simply tanked. He captured barely one-third of the vote in Florida’s heavily Hispanic Miami-Dade County, and less than one-third of the vote in Ohio’s Cuyahoga County (Cleveland) and Michigan’s Wayne County (Detroit). In Los Angeles County, the nation’s most populous, Trump drew barely 20%, as was also the case in Cook County (Chicago) and Washington’s King County (Seattle). He took less than 20% in his home base of New York City, only 15% in Philadelphia, less than 15% in Boston, under 10% in San Francisco, and less than 5% in his new home, Washington, DC.

Yet in spite of Clinton’s dominance of the major urban centers, her margins were not quite big enough in the kingpins of Michigan (Wayne County), Pennsylvania (Philadelphia), and Wisconsin (Milwaukee County), to carry any of those three pivotal states. Clearly, she was hurt by a lack of enthusiasm for her candidacy among African-American voters, who had been much more eager to vote for one of their own in Obama.

Clinton won Wayne County by 290,000 votes, more than 90,000 votes less than Obama’s 2012 margin over Mitt Romney. She carried Philadelphia by a hefty 475,000 votes, but still trailed Obama’s margin four years earlier by 17,000 votes. And Clinton took Milwaukee County by nearly 163,000 votes, but again fell almost 15,000 votes short of Obama’s 2012 margin.

If she had come anywhere close to matching Obama’s 2012 margin in Wayne County, she would have wiped out Trump’s 10,704-vote statewide advantage and carried Michigan and its 16 electoral votes. However, even if Clinton had been able to match Obama’s 2012 margins in Philadelphia and Milwaukee County, it would not have been enough for her to overcome a 22,748-vote deficit in Wisconsin and a 44,292-vote deficit in Pennsylvania. In both states, she would have needed to make up more votes elsewhere.

A closer look at the Pennsylvania results illustrates the problem that Clinton faced. While she slightly underperformed in Philadelphia compared to Obama’s 2012 showing, she over-performed in the Philadelphia suburbs. She swept all four suburban counties (Bucks, Chester, Delaware, and Montgomery) by a combined margin of nearly 190,000 votes, 65,000 votes better than Obama’s suburban advantage four years earlier.

That gave Clinton a lead of more than 660,000 votes heading out of the Philadelphia metro area. Add an edge of nearly 110,000 votes for Clinton in Pennsylvania’s other major population center, Allegheny County (Pittsburgh), and she had an impressive lead of more than 770,000 votes — 65,000 votes larger than Obama’s in 2012 — to withstand a Republican counterattack in the rest of the state.

Obama had been able to do so easily, as Romney could trim only 400,000 votes from Obama’s lead in the vast swath of Pennsylvania outside the Philadelphia and Pittsburgh areas. But the Trump forces concentrated on the state’s interior, with its small and medium-sized cities, old industrial centers, small towns, and rural terrain. Much of the resource-rich territory had seen better days economically and was tailor-made for Trump’s pledge to “Make America Great Again.” While Romney carried seven counties in Pennsylvania with at least 70% of the vote, the number for Trump was 23.

The result was a Trump margin of more than 800,000 votes outside the Philadelphia and Pittsburgh areas, enough for a narrow statewide win. It was the first time that Republicans had carried the Keystone State’s electoral votes since 1988, and they did it with a different playbook than then. In the 1980s and before, the Republicans’ path to victory in Pennsylvania often started by building a big lead in the Philadelphia suburbs. Not so with Trump, who won both the state and the White House by following his own version of the path less traveled.

What follows is a look at how Clinton and Trump did, respectively, in different types of counties across the country. While 2016 was not that much different nationally than 2012 — the Democratic candidate won by about two points nationally instead of by four — there were wild swings at the state and county level that, taken together, allowed Trump to capture the presidency.

2016 results as seen through different types of communities

When it comes to analyzing the vote of various voting groups, exit polls are the “coin of the realm.” But a generation or two ago, prior to the advent of exit polls, political analysts tended to focus on the vote by counties. Some were seen as reliably Democratic or Republican and their margins were closely watched. Others were viewed as bellwethers, and still others as microcosms for various voting groups in their state or the nation as a whole. The latter are known here as “sample” counties, and were compiled for this article by the author. To be sure, exit polls are “purer” than county results since the latter are seldom comprised homogeneously of a single voting group. But unlike polls, they have no margin of error; they reflect actual votes. And they allow for historical comparison with earlier elections about as far back in time as one wishes to go. This table uses county results to illustrate voting patterns in the presidential elections of 2012 and 2016, along with the change, up or down, in the Democratic and Republican presidential vote shares from one election to the other. Counties (as well as cities or towns in some New England states) are clustered here into five basic voting groups: 1) types of communities (major urban centers, major suburban counties, and small-town America); 2) the old and new economies (industrial heritage and high tech); 3) the young and the elderly (academic influence and retirement areas); 4) a look by race (African-American majority, Hispanic majority, and almost monolithically white); and 5) the left and the right (state capitals and military influence, respectively). The 2012 presidential vote is from America Votes 30 (CQ Press, an imprint of SAGE Publications). The 2016 presidential results are from state election web sites. In both years, all votes are based on official returns.

Group 1: Urban, suburban, rural

Table 1: Major urban centers

Urban America has been an integral part of the Democratic coalition since Franklin D. Roosevelt’s New Deal, and Hillary Clinton kept the bulk of the nation’s leading urban counties firmly in the Democratic column in 2016. In many of them, she won by an even wider margin than President Barack Obama did in 2012, although conspicuous exceptions in Michigan (Wayne Co.), Pennsylvania (Philadelphia), and Wisconsin (Milwaukee Co.) proved costly to her.

Note: *Obama won Harris County 49.4% to 49.3% in 2012.

Table 2: Major suburban counties

With Democrats regularly dominating the vote in the nation’s largest cities and with Republicans rolling up the score in rural America, which party has the upper hand in the major suburban counties (particularly in the battleground states) often wins the White House. That was not quite the case in 2016, however. In suburbs from Fairfax Co., VA, to Orange Co., CA, the Democratic vote share was frequently up from 2012 while the Republican share was down (often way down), yet Donald Trump still won the presidency. One leading suburban county that Trump did carry was historically blue-collar Macomb Co., MI, the quintessential home of “Reagan Democrats.” Macomb was carried by President Barack Obama in 2012, but like so many other working-class strongholds, was in the Trump column in 2016.

Table 3: Small-Town America

Rural and small-town America is usually a Republican preserve, and the often gaudy GOP percentages were even greater for Donald Trump in 2016. Meanwhile, the Democratic vote shares — already low for Obama in 2012 — were downright paltry for Hillary Clinton. Many of the counties selected for this section have political or historical significance. Monroeville, AL, was the life-long home of novelist Harper Lee. Hope, AR, was the birthplace of both President Bill Clinton and Republican presidential candidate Mike Huckabee. Dixon, IL, was where Ronald Reagan lived for much of his childhood. Huntington, IN, is the home town of former Vice President Dan Quayle. Winterset, IA, is the birth place of “the Duke,” John Wayne. Russell, KS, is the birth place of Bob Dole. Winnfield, LA, was where Huey Long was raised. Hannibal, MO, was the boyhood home of Mark Twain. Mount Airy, NC, is considered the model for “Mayberry,” the fictional site of the TV comedy that starred Andy Griffith and Don Knotts. Marion Co., OH, was the home of President Warren G. Harding, where he ran a local newspaper. Dayton, TN, was the site of the 1925 Scopes trial, which pitted William Jennings Bryan against Clarence Darrow. The results from Madison Co., ID, last fall were a bit of an outlier. Trump won the county easily, but far below the percentage that Mitt Romney garnered in 2012 in this Mormon part of eastern Idaho. Utah-based independent Evan McMullin took 30% of the county’s vote in 2016.

Group 2: The old and new economies

Table 4: Industrial heritage

Blue-collar America was once an integral part of the Democrats’ voting realm. But for a while now, parts of it have begun to flake off. And in 2016, the Democratic vote share in many counties with an industrial heritage declined badly while the Republican share surged. As a consequence, Donald Trump pulled an array of blue-collar counties into his column, including Pueblo Co. (CO), Dubuque Co. (IA), Luzerne Co. (PA), and Jefferson Co. (TX). Combined with his strength in the vast rural heartland, Trump’s success in industrial America provided him with the major elements of his winning coalition.

Note: *Trump won Pueblo County 46.1% to 45.6% in 2016.

Table 5: High tech

From California’s Silicon Valley to North Carolina’s Research Triangle, America’s high technology areas contain in sizable numbers “the best and the brightest.” In recent presidential elections, these counties have tended to vote overwhelming Democratic. By and large, that continued in 2016. Third-party candidates made significant inroads in several. A former governor of New Mexico, Libertarian Gary Johnson took 14% of the vote in Los Alamos Co., while independent Evan McMullin drew 30% in his home base of Utah Co., UT.

Group 3: The young and the old

Table 6: Academic influence

Academic communities have long been a cornerstone of the Democratic coalition, and Hillary Clinton in 2016 tended to run better than ever in many of them. Take Charlottesville, the home of the University of Virginia, for instance. Clinton swept it with 80% of the vote, and increased the Democratic presidential margin in the city from less than 12,000 votes in 2012 to nearly 15,000 votes in 2016. An asterisk (*) indicates that the county or town is the home of multiple colleges of note. Amherst, MA, is the location of three colleges: the University of Massachusetts, Amherst College, and Hampshire College. Washtenaw Co., MI, is the home of the University of Michigan in Ann Arbor and Eastern Michigan University in neighboring Ypsilanti.

Table 7: Retirement areas

Democrats tend to run better among young voters, Republicans among older voters (particularly those age 65 and up). The latter was the case in spades in 2016, as the Republican advantage tended to widen from 2012 in many counties with a high elderly population. Those listed below have a population at least 20% age 65 and older, according to the 2010 census.

Group 4: A look by race and ethnicity

Table 8: African-American majority

Over the last half century, African Americans have arguably been the most loyal Democratic constituency. Yet not surprisingly, Hillary Clinton did not perform quite as well among them as Barack Obama, the nation’s first black president. The African-American vote turned out to be a two-pronged problem for Clinton in 2016. Not only was the Democratic vote share down a tad in many heavily African-American jurisdictions (outside the Washington, DC, area in particular), but the voter turnout in many of these counties tended to be lower than 2012. Meanwhile, Donald Trump’s plea to African-American voters — “what have you got to lose?” — apparently gained him a little traction in some strongly African-American counties. Those featured in this section are counties with the highest proportion of African Americans in states with a significant black population, according to the 2010 census.

Table 9: Hispanic majority

Donald Trump made it easy for Democrats to once again dominate the Hispanic vote. Throughout the campaign, he repeatedly criticized illegal immigrants and called for the building of a wall along the nation’s southern border with Mexico to rectify the problem — a wall that he insisted would be paid for by Mexico. Nearly all of the Hispanic-majority counties are in the Sun Belt, especially Texas. However, there are a few predominantly Hispanic counties in far-flung parts of the country, such as Seward Co., KS, and Adams Co., WA, that stand out because of their Republican pedigree. The counties included below have the highest proportion of Hispanics in their state, according to the 2010 census. Populous Bexar Co. (San Antonio), TX although not one of them, is also included.

Table 10: Almost monolithically white

Democrats do not tend to draw many votes in the almost monolithically white areas of the country, and they ran even worse than usual in these overwhelmingly Caucasian counties in 2016. They tend to be rural in nature, and many can be found in Appalachia and the rural Midwest. In a number of them, the already small Democratic vote share dropped by at least 10 percentage points from 2012, while Donald Trump drove up the Republican share by a similar amount. The white proportion of the population in all of these counties is at least 98.4%, according to the 2010 census.

Group 5: The left and the right

Table 11: State capitals

State capitals, especially those located in fair-sized cities, often combine a large government work force with a sizable minority population. That combination often lands them in the Democratic column regardless of how their state as a whole votes. Even then, Donald Trump found it difficult last fall to match Mitt Romney’s 2012 vote percentage in a number of these capital counties.

Table 12: Military influence

Many of the nation’s major military installations are found in conservative parts of the Sun Belt and regularly provide Republicans with clear-cut majorities. Even then, Hillary Clinton was unable to match Barack Obama’s 2012 vote percentage in many of these counties.