To me it's fairly evident why Obama lost. No, it wasn't because voters abandoned him at the last minute. They didn't. It wasn't because they lied to the pollsters when they really meant to vote for Hillary. They didn't.
The average percentage of voters who said they would vote for Obama was 37%. The actual count was 36%, which falls well within the margin for stastical error. So whoever said they would voted for him probably did so in the end.
No, what happened was that everyone naturally saw from the polls that Obama was going to win if they didn't do something about it. Those who didn't want him as their president and were rooting for candidates they could see were going to lose anyway switched sided and voted for Hillary to stop Obama. You can see from the vote count that the losing candidates lost at least half their supporters literally overnight.
The NH electorate was well predisposed to do this as it predominantly comprises independents who could thus switch sides whenever they were so inclined. In states with a lower percentage of independents, the polls are much more likely to predict the true outcome, since voters are much less likely to switch sides as much or as quickly.