For all the talk about why Donald Trump was elected president while losing the popular vote and how he could win again, one of the least discussed results of the 2016 election offers valuable lessons for Democrats.

An astounding 7.8 million voters cast their presidential ballots for someone other than Trump or Hillary Clinton. The two biggest third-party vote-getters were Libertarian nominee Gary Johnson (almost 4.5 million votes) and the Green Party’s Jill Stein (1.5 million voters). But others received almost another 1.9 million votes as well.

Libertarians and Greens may try to convince you that this reflects growing support for their parties. It doesn’t.

Their strong showing was due to the unpopularity of the two major-party nominees.

Remember, Johnson and Stein were also on the ballot four years earlier, and the former drew under 1.3 million votes and the latter not quite 470,000 votes.

In 2004, the two major-party nominees, George W. Bush and John Kerrycombined for 99 percent of the popular vote.

Four years later, Barack Obama and John McCain drew 98.6 percent of the popular vote. And in 2012, Obama and Mitt Romney took 98.3 percent of the popular vote, according to the Federal Election Commission.

But in 2016, Clinton and Trump together received only 94.27 percent of the popular vote.

Both were so widely unpopular that millions of voters opted to waste their votes by supporting third-party candidates who had no hope of winning.

Breaking down the votes

Two key swing states, Pennsylvania and Wisconsin, make clear what occurred.

The Democratic presidential nominee carried Pennsylvania in 2004, 2008 and 2012. Kerry and Obama’s popular-vote margins in those three contests ranged from a low of 144,000 votes in 2004 to 620,000 in 2008. In all three elections, the Democrat received a majority of the vote.

The weakest showing was in 2004, when Kerry won with 50.9 percent of the vote and defeated Bush in the state by 2.5 points.

But in 2016, Trump carried the state by 44,000 votes — just over seven-tenths of a point, even though he won 48.2 percent statewide.

Obama and Romney combined for 98.6 percent of Pennsylvania’s popular vote in 2012, but Trump and Clinton combined for only 95.6 percent four years later.

While third-party hopefuls drew just under 83,000 votes in the Keystone State in 2012, they drew more than three times that number, 268,000 votes, four years later. Apparently, hundreds of thousands of Pennsylvania voters couldn’t stomach either of the major parties’ nominees, so they cast protest votes for third-party and independent candidates.

The same thing happened in Wisconsin, but in an even more stunning way.

Wisconsin was a near dead heat in 2004. (Kerry won it by a mere 11,000 votes.) But Obama carried it by comfortable margins in 2008 (415,000 votes) and 2012 (213,000 votes).

Then in 2016, Trump carried the Badger State by fewer than 23,000 votes. But his vote total was less than what Romney received in 2012 — yet Trump carried the state while Romney lost it by over 200,000 votes.

Third-party and independent hopefuls in Wisconsin drew 39,000 votes in 2012 but more than four times that number, 188,000 votes, four years later.

At the same time, the major-party vote there dropped from just over 3 million in 2012 to 2.8 million in 2016.

Major-party baggage

Elsewhere, the same thing happened.

In Florida, the third-party presidential vote quadrupled from 73,000 votes in 2012 to 297,000 votes in 2016.

In Michigan, it increased almost five-fold, from 51,000 to almost 251,000, while the total number of votes in the state for major-party nominees fell.

Some third-party votes came from Libertarians, Greens and others who regularly vote third party.

But the surge in third-party and independent voters undoubtedly reflected the baggage of the major-party nominees in 2016.

Increased support for third-party candidates occurred in every state, though with differences in magnitude.

In very pro-Trump states like Mississippi, Louisiana and West Virginia, the increase was muted, since there were fewer defections from Trump and Clinton in those states.

Many conservative and pragmatic Republicans found Trump vulgar, narcissistic, intellectually lazy and unqualified to be president, but they couldn’t force themselves to vote for Clinton.

On the other hand, some Democrats saw Clinton as insufficiently progressive and untrustworthy, and there was no way they could vote for her.

What it means for 2020

In theory, Trump could have reached out during his presidency to Republican defectors. Instead, he chose to double-down on personal attacks, nationalist rhetoric and divisive appeals to non-college-educated whites, who helped elect him.

That makes it unlikely for Trump to attract many of those who wasted their votes in 2016.

On the other hand, Democrats have the rare opportunity next year to woo progressives, Republicans and swing voters who threw their votes away by supporting third-party nominees.

Progressives now see the damage Trump has done, and Republicans who rejected Trump in 2016 have had their worst fears about him confirmed.

But if Democrats select a nominee who is again unpalatable to many voters, as Clinton was, that could send anti-Trump Republicans and swing voters back to third parties again in 2020.

While it is completely true that the Democrats “waste” large numbers of popular votes in California and New York, that’s not why Clinton lost in 2016.

She failed to mobilize anti-Trump voters, too many of whom decided that they couldn’t support either major-party nominee. Winning those voters who defected from the two major parties would be an important step for either side.

And right now, only the Democrats are in a position to take advantage of that, which is not good news for Trump, not only in Michigan, Pennsylvania and Wisconsin, but also nationally.

Note: An earlier version of this column appeared initially on the Roll Call website on July 29, 2019.