Seth Godin has done an insightful analysis of the marketing of this election.
In a nutshell, he says that McCain, who always appealed to the less conservative Republicans, took a big risk to get the socially conservative, Karl-Rovian-"base" by naming Palin as his VP; and as a result lost his own base to Obama. (My neighbor, who once worked for McCain's previous campaign, was one of them.) He also speculates that they hoped Palin could pick off the Hillary supporters, which proved to be a disastrous choice.
Obama, on the other hand, knew that the Democratic base, or "tribe" in Godin's marketingspeak, wasn't enough to get him elected -- so he embarked on a very expensive, and very successful campaign to weave together a new tribe -- of people who had never voted before, blacks and hispanics, and people whose worldview was larger than the us-versus-them mentality.
The negative attack ads didn't work, Godin alleges, because -- like us Apple evangelists -- any attack on Obama we took personally, and when the Obama campaign asked for a small donation to fight the smears, we responded. In huge numbers. $25 here and there adds up quickly when you've got a huge new tribe behind you.
In many states, McCain got exactly the same numbers Bush got in the last election -- but they just weren't enough to overcome Obama's new base.