Going into Election Day, all the major polls and news organizations like FiveThirtyEight, the Los Angeles Times and the New York Times predicted that Donald Trump would lose the presidential race by several percentage points to Hillary Clinton in the popular vote, and also, more importantly, lose the Electoral College.

But early returns Tuesday showed Trump outperforming predictions in the key battleground states of North Carolina and Virginia. Then states that supported Democratic presidential nominees in recent elections — Michigan, Wisconsin and Pennsylvania — showed Trump with early leads. Around 9:30 p.m. the New York Times pegged Trump as the favorite and on a trajectory that would continue to rise through the night.

So how did all these election analysts and pollsters get it wrong? What had they missed?

“Figuring out how to map your poll sample onto the electorate that will be turning out at the ballot box is hard, and the tendency is to rely on what’s worked in the past,” said Tim Groeling, chair of the communications studies department at UCLA and an expert on elections.

“In this case,” Groeling said, “it appears that there were [at least] two bad assumptions baked into the polling cake: that non-white voters would vote for and turn out for Hillary Clinton like they did for Barack Obama, and they underestimated the likelihood that poor white voters would turn out, based on past performance.”

Based on the New York Times exit polling, Groeling noted that Obama outperformed Clinton by 7 points among blacks, but 11 points among Asians and 8 points among Hispanic/Latinos. In contrast, whites only shifted a single point to Trump. But when the vote is broken down by income, Trump picked up 16 points among white voters whose incomes were less than $30,000 a year and 6 points among those between $30,000 and $50,000.

Juliet Williams, UCLA professor of gender studies and an expert on gender roles in politics, noted that gender played an underreported role in the election — beyond the fact that Clinton was the first woman to be a major party’s nominee.

“The big headline turned out to be a gender conversation that no one saw coming: the pivotal role that less-educated white women played in pushing Trump over the finish line,” Williams said. “In retrospect, it’s a stunning oversight — and, ironically, one that reveals a deeply dismissive regard for women, even among those who should know better.”

Williams said that from the earliest stages of the campaign the dominant narrative was that this election would pit angry white men against a diversifying electorate.

“This story made sense — except we forgot to pay attention to all the mothers, wives and daughters living alongside those angry white men,” Williams said. “Those angry white women who came out in droves for Trump were there all along, but we didn’t see them, allowing their stories and struggles to be overshadowed by a drama in which the role of the angry white voter was presumptively cast as male. That’s another side of sexism, and a stinging reminder that sexism is everyone’s problem — and we all still have a long way to go.”

Mark Peterson, professor of public policy at the UCLA Luskin School of Public Affairs, pointed out that the national poll averages for the Clinton margin were not that far from the margin of error in the polls.

“Moreover, the forecasting models had explicit probability predictions,” Peterson said. “In running their simulations they produced some results that charted a victory for Donald Trump. And because that probability was fairly small, i.e., from 16 percent to 30 percent in the two of the most-watched forecasts, this turned a ‘likely’ win by Hillary Clinton into a ‘sure’ win in people’s perceptions.”

Clinton’s loss proved bitterly disappointing to the millions of people who cast their votes, thinking they were finally electing a woman to the highest office in the land, said Ellen DuBois, distinguished professor of history and women’s studies.

“I think this was a kind of perfect storm against Hillary,” said DuBois, who has studied the history of women’s suffrage in the United States. “Yes, she suffered because of her gender, but she also profited by the support and excitement of lots and lots of women. I believe that it would be almost impossible for a woman to ‘come out of nowhere’ politically, as did Trump, because distrust of women and their capacities is so great; a woman president will have to have proved herself many times over, as Hillary certainly did.”

Laura Gomez, professor of Chicana and Chicano studies and a professor in the UCLA School of Law, also pointed to turnout in addition to gender discrimination.

“Everyone expected the election to be close and knew it would come down to turnout. Trump excited voters, including some traditional Democratic voters like white blue-collar workers and, although we'll learn more in days to come, apparently also some Latino voters,” said Gomez, who is interim dean of social sciences in the UCLA College. “Some have described this vote as a ‘whitelash,’ but I also think it indicates a strain of resentment about changing gender roles — on the part of some men but also some women.”

Daniel J.B. Mitchell, emeritus professor in the UCLA Anderson School of Management, said that journalists were overly reliant on polls.

“Pollsters essentially had a ‘Dewey Beats Truman’ event,' Mitchell said. “Journalists and others should look very skeptically at statements indicating this or that poll is accurate within, say, 2 percentage points. They should also look very skeptically at poll-based models that purport to give precise readings of the odds that a candidate will win. That type of accuracy simply is not possible.”

Jim Newton, lecturer in public policy at UCLA Luskin and former longtime L.A. Times journalist, suggested that Trump’s low favorability ratings might have affected the accuracy of the polls.

“Trump supporters may have been reluctant to share their support with pollsters, either because they were embarrassed or because they so disliked the polling that they were willing to mislead,” Newton said.

One way or the other, it's clear that Trump supporters’ feelings have been ignored, said Zev Yaroslavsky, director of the Los Angeles Initiative at UCLA Luskin.

“The conventional wisdom, which is usually defined by the Washington punditry and political elite, missed the intensity of the anxiety and frustration many of our citizens feel,” said Yaroslavsky, an authority on California state politics and government, having served 40 years as an elected official. “That undoubtedly bled into the modeling assumptions that were made. In a close election, as this was, it can be the difference between a right or wrong call.”

And perhaps the historical record isn’t being given enough credit, Peterson noted.

“This was a third-term-for-the-incumbent-party election, and only George H.W. Bush in 1988 had been successful in such a race in the modern era,” he said.