I've seen a lot of theories floated. Most likely it's a combination of multiple factors:
1) She was never up 20+. Those polls were junk. She may have been up in the low double digits like Monmouth showed, or perhaps they were a bit off too and it was actually high single digits. In addition, no polls besides junky Mitchell were out in the field late, which was a similar problem that happened in Iowa this year. Polls were also wonky because there hasn't been a competitive Michigan primary in a long time, so they were unsure how to model it.
2) Bernie outspending her paid off.
3) Hillary supporters got complacent, and either decided to stay home or cross over to vote in the Republican primary because she already had it "locked up."
4) Bernie got a debate bump. Most people didn't think it would make much of a difference, but perhaps the voters thought differently. The trade portions in particular may have hurt Hillary.
5) Youth and independent turnout was much larger than expected.
Likely some or all of these conspired together to create the perfect storm.
3 and 5. As for 5, an unusually high 11% of MI Dem voters were under 25, as opposed to only 6% of MI GOP voters. The under 25 Dems went for Sanders 85-15. If their proportion of the total was 6% rather than 11%, Clinton would have won.
As for 3, take Huntington Woods, a middle-class, extremely highly educated, liberal-leaning suburb of Detroit. Fully 33% of Tuesday's vote was cast on the GOP side, which is a higher fraction than the GOP has won in a GE since 1988. Kasich won a whopping 58%, while on the Dem side Clinton won just 51-47, even though the community is a natural fit for Clinton. I take it a few hundred Clinton supporters crossed over to vote Kasich, to try to stop Trump.