At this writing, Hillary Clinton has won the 2016 presidential popular vote by 1.7 million votes (1.3 percent). Unfortunately, she lost the electoral college (232 to 290) because Donald Trump carried the 13 swing states by an aggregate 850,000 votes (1.9 percent). Many Democrats think Hillary was cheated; they believe there were nefarious political tricks that cost her the election. There's not a clear-cut case.
1. Comey's intervention. The Clinton campaign blames her loss on the October 28th intervention by FBI Director James Comey who, in effect, reopened the issue of the Clinton email server. Certainly this was an unprecedented act; one that some Washington observers felt violated the Hatch Act. Coming out of a strong performance in the third presidential debate, Hillary had momentum; some saw her winning by double digits.
Then the Comey memo was issued and the momentum shifted. Writing in The Guardian (https://www.theguardian.com/commentisfree/2016/nov/15/pollsters-fail-predict-trump-victory-fbi-clinton?CMP=oth_b-aplnews_d-1) veteran pollster Stan Greenberg observed, "The [Clinton] campaign's close was disrupted by a flood of hacked emails, whose release was linked to Russia, intended to show that friends of Bill Clinton were using the Clinton Foundation to enrich the former president, and then by FBI director James Comey's letter to Congress... This allowed Trump to close his campaign with a call to 'drain the swamp' and reject 'the Clintons' big business trade deals that decimated so many communities'."
Did this shift in momentum cost Clinton the electoral college? Writing in Mother Jones (http://www.motherjones.com/kevin-drum/2016/11/why-did-trump-win-roundup-most-popular-theories) Kevin Drum opined, "My guess is that his last minute intervention swayed the vote by about 2 percent." (The 538 website agreed.)
Writing in the Washington Post, Aason Blake (https://www.washingtonpost.com/news/the-fix/wp/2016/11/17/how-america-decided-at-the-very-last-moment-to-elect-donald-trump/) observed that last-deciding voters broke strongly for Trump: "In Florida and Pennsylvania, late-deciders favored Trump by 17 points. In Michigan, they went for Trump by 11 points. In Wisconsin, they broke for Trump by a whopping 29 points, 59-30."
By the way: Hillary's emails were a big deal to many voters. Writing in the Washington Post, Chris Cillizza (https://www.washingtonpost.com/news/the-fix/wp/2016/11/10/the-13-most-amazing-things-in-the-2016-exit-poll/) noted: "Almost two-thirds of Americans (63 percent) said that Clinton's 'use of private email' bothered them 'a lot' or 'some.' Among that group, Trump won 70 percent to 24 percent."
2. Clinton's Response: Pollster Stan Greenberg argues that, after the Comey memo, the Clinton had time to fight back but didn't do so effectively: "[The Clinton campaign] used its advertising muscle to shift the spotlight from Clinton to Trump. Its ads running right through the very last weekend showed Trump at his worst. By then, nobody could remember that Hillary Clinton was a candidate with bold economic plans who demanded that government should work for working people and the middle class, not corporations. She was no longer a candidate of change."
Writing in The Nation, Joan Walsh (https://www.thenation.com/article/did-race-or-class-doom-hillary-clinton/) cites Stan Greenberg's study, " The Clinton campaign stopped making a strong case for her populist economic policies in the closing weeks of the campaign, research by Greenberg's Democracy Corps found. A poll of 1,300 voters--including 400 who are considered part of the rising American electorate of black, Latino, and other nonwhite voters plus unmarried white women (also known as the Obama coalition)--found they never heard her strongest economic pitches throughout the long campaign."
3. Disgruntled Bernie voters: Perhaps it is the case that Clinton lost key swing states because of disgruntled Bernie Sanders voters. In Pennsylvania, Clinton lost by 68.000 votes while Gary Johnson and Jill Stein got 190,000 votes. In Wisconsin, Clinton lost by 27,000 votes while Gary Johnson and Jill Stein got 136,000 votes. In Michigan, Clinton lost by 11,000 votes while Gary Johnson and Jill Stein got 223,000 votes.
There are not definitive studies in Michigan and Wisconsin, however in Pennsylvania the prestigious Brookings institute (https://www.brookings.edu/blog/fixgov/2016/11/11/why-hillary-clinton-lost-pennsylvania-the-real-story/) felt there was a clear reason for Clinton's loss: "Although Clinton's statewide total in Pennsylvania fell just short of Obama's in 2012, this modest shortfall was not why she lost the state. The real story is that Donald Trump ran up the score in every Republican-leaning rural and small-town county, besting Mitt Romney's statewide total by nearly 300 thousand votes."
4. Stolen votes: Rumors persist that Hillary's stunning losses in supposedly solid swing states was due to various forms of voter suppression. Writing in Alternet, Steven Rosenfeld (http://www.alternet.org/election-2016/fair-election-serious-hard-explain-questions-arise-about-trump-vote-totals-3-key) examined five states including Pennsylvania, Michigan, and Wisconsin. In Pennsylvania and Wisconsin there are questions about results in areas that use electronic voting machines that provide no paper trail. In Michigan, there will be a recount due to the fact that "87,000 ballots did not show a presidential vote," a result that could indicate faulty optical scanners.
Clinton lost Michigan, Pennsylvania, and Wisconsin by a total of 106,000 votes. An excellent analysis by German Lopez (http://www.vox.com/policy-and-politics/2016/11/11/13597452/voter-suppression-clinton-trump-2016) concludes that voter suppression does not explain Clinton's loss in Michigan and Pennsylvania: "In Pennsylvania, Clinton got 2 percent fewer votes than Obama did in 2012, while Trump got 11 percent more than Mitt Romney. In Michigan, Clinton got 11 percent fewer votes than Obama did in 2012, while Trump got 8 percent more than Mitt Romney. Clinton simply got fewer people to turn out for her than the last Democrat who ran, while Trump appeared to get more than the previous Republican."
Conclusion: On October 27th, Hillary Clinton was ahead in the polls but a significant number of voters did not trust her because of her email problem. FBI Director Comey's October 28th memo reminded these voters of their concerns about Hillary and they began to move towards Trump. In the remaining 10 days, Clinton had an opportunity to blunt Trump's new momentum -- with an economic message -- but failed to do this. As a consequence, late-deciding voters went with Trump, seeing him as an agent of change, even though they didn't like him.