Hillary Outsmarted

How did Barack manage to snatch the nomination away from Hillary? Was it just inspirational rhetoric? Nope.
Obama's campaign mastered some of the most arcane rules in politics, and then used them to foil a front-runner who seemed to have every advantage—money, fame and a husband who had essentially run the Democratic Party for eight years as president.
The overconfident Clinton just figured she was going to win, and left the door open for Barack's people to outmaneuver her.
Obama used the Democrats' system of awarding delegates to limit his losses in states won by Clinton while maximizing gains in states he carried. Clinton, meanwhile, conserved her resources by essentially conceding states that favored Obama, including many states that held caucuses instead of primaries.
When her shock and awe campaign failed, the groundwork hadn't been done to give her the ability to win in hand to hand combat.

The system enables strong second-place candidates to stay competitive and extend the race—as long as they don't run out of campaign money.

"For people who want a campaign to end quickly, proportional allocation is a bad system," Devine said. "For people who want a system that is fair and reflective of the voters, it's a much better system."

One of the systemic quirks that worked to Barack's favor is the idea that congressional districts that usually vote for democrats over republicans get more delegates than ones that vote republican.

"Black districts always have a large number of delegates because they are the highest performers for the Democratic Party," said Elaine Kamarck, a Harvard University professor who is writing a book about the Democratic nominating process.

"Once you had a black candidate you knew that he would be winning large numbers of delegates because of this phenomenon," said Kamarck, who is also a superdelegate supporting Clinton.

So, the smart folks running Hillary's campaign were so brimming with confidence that they didn't think it was necessary to do the legwork necessary to fill the cracks in the system that made them vulnerable. Or, they just didn't see the vulnerability.