In 2004, I don't know how John Kerry did so well and got 251 electoral votes. He was very close to becoming President!
And in 2012, Romney was tied with Obama with the polls at the very end, when they're tied in the polls at the very end, the Republican usually wins.
1. Bush did not run a good campaign, truthfully he didn't deserve to win that year, just 150,000 votes different would've made the difference [whether by Ohio, or over the cascade of New Mexico, Colorado, Nevada, and Iowa].
2. Romney was never tied in the state polls of the swing states, the one place he was ahead was North Carolina...and iirc, Obama abandoned efforts there.
Romney was also up 1.5 in Florida and down only 0.3 in Virginia, by the way.
I just went back and looked at the final RCP averages from 2012. Obama outperformed the polls in every single swing state. And in the national PV, he won by +3.9, compared to the RCP average of +0.7. This was due to huge minority and youth turnout for Obama in 2012 and the missing white voters in the Rust Belt.