If Bernie Sanders were to defeat Hillary Clinton in Michigan’s Democratic primary, it would be “among the greatest polling errors in primary history,” our editor in chief, Nate Silver, wrote Tuesday evening when results started to come in. Sanders pulled it off, and now we’re left wondering how it happened. How did Sanders win by 1.5 percentage points when our polling average showed Clinton ahead by 21 points and our forecasts showed that Sanders had less than a 1 percent chance of winning?

With a polling miss this big, no single factor is likely to explain it, so more than one answer could be correct. Also, not every pollster releases detailed data, and it may take some time to fully diagnose what went wrong. “It’s a little bit of everything,” Monmouth University pollster Patrick Murray told The Huffington Post.

Here is our initial assessment of some possible explanations, along with comments from some of the pollsters who had reported a big Clinton lead:

Pollsters underestimated youth turnout. Voters under 30 made up 19 percent of Democratic primary voters, nearly as large a share as voters 65 or older, according to exit polls. Mitchell Research and Communications, which showed a 37 percentage point Clinton lead in a poll conducted Sunday, found that people younger than 50 would make up less than a quarter of all voters; they made up more than half instead. Mitchell was one of the only pollsters in the state to poll using only calls to landlines, and most Americans younger than 45 live in households without landlines. But even Monmouth, which dialed cellphones, too, underestimated the turnout among younger voters. Perhaps all the polls showing a big Clinton lead sowed complacency among Clinton supporters, who skew older — though big leads in polls in Southern states didn’t stop her supporters from helping her romp to big victories.

Pollsters underestimated Sanders’s dominance among young voters. Not only did more young voters turn out than expected, but Sanders won 81 percent of 18- to 29-year-olds. A YouGov poll showed him winning 66 percent.

Pollsters underestimated the number of independent voters who would participate in the primary. YouGov expected Sanders to beat Clinton by 38 percentage points among independent voters participating in the open Democratic primary. He won those voters by 43 percentage points. But no one expected independents to make up 27 percent of voters; YouGov expected about 12 percent. “There were too many Democrats in the poll,” said Will Jordan, elections editor at YouGov.

Pollsters underestimated Sanders’s support among black voters. Sanders had won less than 20 percent of black voters in most states with large black populations, and Mitchell and YouGov both showed Sanders winning less than 20 percent of them in Michigan. Instead he won 28 percent.

Pollsters missed a late break to Sanders by not doing enough polling after Sunday. Clinton and Sanders debated in Flint on Sunday and met in a town hall in Detroit on Monday. Among public pollsters, only Mitchell contacted voters after either event. Sanders did slightly better among voters who decided in the week before the primary, according to exit polls. An earlier polling miss, in the Iowa Republican caucuses, may have resulted in part from a scarcity of late polls. And there were signs before Sunday that Sanders was closing the gap: In the YouGov poll, 45 percent of Michigan Democrats said their opinion of Sanders was getting better, and just 8 percent said it was getting worse. For Clinton, the numbers were 38 percent and 19 percent.

Some Clinton supporters chose to vote in the Republican primary. We know 7 percent of voters in the Republican primary identified themselves as Democrats to exit pollsters, compared with just 4 percent of voters in the Democratic primary who said they were Republicans. “Those 7 percent of Dems were likely mostly Hillary voters who thought she had an easy win and they could do their part trying to stop [Donald] Trump,” said Bernie Porn of pollster EPIC-MRA. The exit-poll samples are too small, though, to check that.

Pollsters had little recent history to work with. Michigan’s Democratic primary was weird in 2008 (Barack Obama wasn’t on the ballot), and the state party held caucuses in 2000 and 2004 that weren’t really competitive. So relying on voter history could lead pollsters astray. “Remember, we haven’t had a real Democratic presidential primary in Michigan lately,” said Matt Grossmann, director of the Institute for Public Policy and Social Research at Michigan State University, which showed the tightest race of any late polls, with Clinton leading by 5 percentage points.

This is an outlier, a perfectly rotten combination of bad luck and bad timing. Several pollsters pointed out that they used the same methods in the Michigan Democratic primary as in other primaries — including Michigan’s Republican primary — with relative success.

“Polls on the Republican race, including ours, were generally OK,” said Barbara Carvalho of the Marist Poll. She added that all polls on the Democratic race had Clinton winning. “So, something clearly changed in the closing days.”

CORRECTION (March 16, 6:53 p.m.): A previous version of this article misstated the number of polls of the Democratic primary in Michigan conducted after either the March 6 debate or the March 7 town hall. There was one, not none.

Listen to the latest episode of the FiveThirtyEight politics podcast.