I personally thought Bernie was encouraged to run, as he would run so far left such that Hillary would look like a centrist. Too bad for the democrats they didn't realize so many of their voters would love Bernie's message about ‘free-stuff’. I don't think they thought for a minute he would be a serious threat. Again, it shows how little they know about the country.
Everything was rigged for Hillary. The primaries were rigged for her. Press accounts said she wanted to run against Trump. The press was 90% in favor of Hillary. They had the Billy Bush tape and started dropping Russian collusion hints well before election day. I doubt Wiki Leaks hurt her all that much. The MSM downplayed or ignored it all together. Mishandling of emails likely didn't hurt her. Any democrat that flipped their vote to Trump was cancelled out by Rino never Trumpers..