Clinton couldn't run on issues like Barack Obama did. Obama was running against a 3rd term of George W. Bush. Clinton was running for Obama's third term. George H.W. Bush ran for Reagan's third term. SNL made fun of him for "stay the course," but it worked. Al Gore ran for Clinton's third term but then tried to distance himself from it. It created a jumble, but he did win the popular vote. John McCain was DOA because of George W. Bush.
Hillary Clinton had no policy differences with Barack Obama until she came out against the Trans Pacific Partnership. People liked Obama and might've supported him for a third term if he ran. What they didn't want was someone who supported his policies that wasn't him. They didn't want a Washington insider. Yet Clinton was a Washington insider who supported Obama's policies. The server scandal and Goldman Sachs speeches reinforced all her negatives.
If she couldn't run on the issues or experience all she had was the woman card and Trump is awful. Clinton has never been comfortable as feminist icon and was clumsy with the woman card. Her efforts to paint Trump as awful led to her "Deplorable" speech. And there were enough people who disliked Trump enough to give her the popular vote. Just not where it counted.
Bernie Sanders ran a very different campaign. He had no problem running against Obama, even if he didn't say it explicitly, and the establishment insiders that Barack Obama was part of. Sanders said the economy wasn't working for people. No one said it was Barack Obama's economy he was talking about but the President owns the economy. Sanders is depicted too far to the left to win, but his far left stances were mixed with populism and struck all cords with the angry voter. Black and Hispanic Clinton voters might've stayed home but that wouldn't have cost Sanders states like New York and California. In the Rust Belt, however, he could've gotten white working class voters who felt that no Democrats was talking about the issues the way Trump and Sanders were and won the states Clinton didn't.
Clinton is derided for not going to Michigan and Wisconsin but I don't think that would've helped her. She spent time in Pennsylvania, Iowa, Ohio, and Florida and couldn't win the white working class votes in any of them. She wasn't going to win them anyway. Sanders could've won just enough to win the electoral college. Clearly Clinton couldn't.