There will be no end of postmortem examinations and theorizing on what the critical winning factor was by both sides to the point where we may never know for sure what the real deciding factor was.
I personally think Obama won because on the whole, American voters are not as forgetful or simple as the GOP seem to take them for.
It was only right that the Republicans be made to pay for the childish and petty way they have tried to sabotage Obama's presidency by point blank refusing to co-operate with the Democrats unless they got things their way, no matter how much it might have benefitted the country to co-operate, or how badly it would have damaged the country to fail to act.
The GOP itself have been hijacked by radicals like the Tea Party, and the extreme views needed to secure GOP nomination was also a massive hinderance, since their candidate either becomes unelectable if he sticks to those extremist views in the Presidential race, or be easily branded a flip flopper if he soften his stance to appeal to a wider base, as Obama as done with Romney.
If the GOP wants to actually win an election, they need to give the loonies the boot, and return to stake a meaningful claim to the middle ground, rediscovered the forbidden art of compromise, and above all else, remember to place national interests above party politics.
Just my thoughts on the matter.