Republican presidential nominee Donald Trump arrives for his election night rally in Manhattan. (Andrew Kelly/Reuters)

Lesson 1: Early political science forecasts were, on average, correct.

In January 2014, I wrote a piece called “The Democrats’ uphill battle to 270 electoral votes.” That piece was predicated on conditions in the country at the time: economic growth, the president’s approval rating and the greater tendency of the White House to change parties after two terms than one term, also knows as “time for a change.”

In March 2016, Michael Tesler, Lynn Vavreck and I drafted an article — subsequently published in August 2016 — in which we suggested that there were mixed signals in the American electorate. People’s views of the economy had recovered, although a variety of political assessments remained more pessimistic. Taken together, economic growth and presidential approval gave the Democrats only a modest chance of winning. If you factored in “time for a change,” the Republicans were favored.

Other early forecasts by political scientists and economist Ray Fair showed the same thing. Vox took several such forecasts, asked two political scientists to average them, and came up with a narrow Republican victory in the national popular vote. Yesterday, the full roundup of these forecasts by Pollyvote said that Clinton would win the popular vote by 0.4 points. Currently, she has a 0.2 percent lead. She will probably exceed that, but the point stands: Those models said it was supposed to be close.

Then, like most observers — including, apparently, the Trump campaign — I believed the forecasting consensus that Hillary Clinton would win and wrote as much yesterday. There were forecasts that gave Trump at least a reasonable shot, including the 24 percent chance given by the forecasters at our partner, Good Judgment. But I went with that consensus and, like others, thought Trump would underperform the average of the political science forecasts. So I was wrong too.

Much will be written about why the polls in particular underestimated Trump’s vote share. It is all the more puzzling because serious attempts to measure the “hidden” Trump vote struggled to find much evidence of them.

But for now, a striking fact is that the election ended up looking a lot like an average of the fundamentals-based models from several months ago.

Lesson 2: Party loyalty is still very potent.

Another striking fact is also consistent with political science: Despite a sense that Trump might not consolidate the support of rank-and-file Republicans — especially with some Republican leaders breaking with Trump or endorsing him lukewarmly — Republican voters coalesced around him much as Democrats did around Clinton. In the exit poll, 9o percent of Republicans supported Trump, nearly identical to the percentage who supported Romney in 2012.

Perhaps part of that loyalty simply stems from strong hostility toward the opposite party. Back in June, Alan Abramowitz and I noted that partisans were more likely to dislike the opposing candidate than they were to like their own candidate. That may have kept Republicans — nearly a quarter of whom did not think Trump was qualified, according to the exit poll — in the fold.

Lesson 3: Candidates and campaign activity seemed to matter less than we thought. Or at least I thought.

Trump was the less popular of the two candidates, raised less money, aired fewer ads and had fewer field offices. Normally, political science would say that candidates and campaigns don’t have a large effect on the outcomes of presidential elections. But part of the reason is that the candidates and campaigns are roughly equivalent in talent, resources and so on. This creates a “tug of war” dynamic, as Lynn Vavreck and I described in our book on the 2012 election, with no chronic net advantage for either candidate. The campaigns are actually mattering, but mainly canceling out each other’s effects.

This election seemed to suggest a durable advantage for Clinton — one that some observers thought would lead her to outperform, not underperform, the polls. It was certainly an election where I thought that candidates and campaigns might matter. Clearly that was not true, or at least not in the most obvious way. This surprised me.

Lesson 4: Identity politics can help either party.

During the primary, Michael Tesler and I noted two key features of Trump support: people’s financial anxiety and racial attitudes. This appears entirely consistent with the types of people and places who swung toward Trump on Tuesday, especially working-class whites. For many of these whites in rural places, their feelings about politics may also reflect an anti-elite consciousness described by Kathy Cramer in her book, “The Politics of Resentment.”

In our August article, Tesler, Vavreck and I noted that many observers thought the country’s growing ethnic diversity would help the Democrats, especially as nonwhite groups had moved toward the Democratic Party. But we added this caveat:

The question, however, is whether increased Democratic support from nonwhite voters may be offset by greater Republican support and higher turnout from whites.

We cited an April post from Larry Bartels titled “Can the Republican Party thrive on white identity?” Bartels described evidence that the demographic change drove whites toward the Republican Party. He concluded: “In an increasingly diverse America, identity politics will continue to cut both ways.” That certainly seems true today.

Lesson 5: Politics is cyclical.
Here’s a nice tweet from FiveThirtyEight’s Harry Enten earlier today:

I made this same point after 2008 and 2012. Interpretations of elections as auguring fundamental realignments are often wrong. There is far more contingency in politics than “demography is destiny” would assume.

The question now is whether there will be a cyclical shift back to the Democrats or whether the movement in 2016 — particularly of the white working-class toward the GOP — proves stickier. Political scientists like Lee Drutman have been “betting the over,” as it were, on fundamental and permanent shifts in the party coalitions.

I’ve always been a bit more cautious. But caution did not get me too far in this election.