There's been a theory that Donald Trump entered the presidential race to make it easier for Hillary Clinton to be elected. This is mostly based on a phone conversation between Trump and Bill Clinton shortly before Trump decided to run.
Let me suggest a different theory. What if the Clintons used the Democratic machine to encourage Bernie Sanders to run? They could have thought that she needs some competition in order to get attention during the primary season, who better than Sanders? He's out of the mainstream and comes off as a little odd. He definitely lacks the practiced political polish of the Clintons. What a surprise it must be to them that he's proving to be a real challenge for her to beat.