Barack Obama was elected because he is black the first time. I have no idea why he was elected the second time. The novelty of a black president had worn off, he had revealed himself to be completely incompetent and corrupt and he sure as hell didn't do anything to be reelected for. Michelle Obama said: “Being president doesn't change who you are — it reveals who you are.” And Barack Obama certainly revealed who he is and it ain't pretty!
Incumbent presidents have only lost elections 3 times in the history of this country. I'm not sure why, but for some reason, people don't like swapping out presidents very often; maybe it's a "the enemy you know is better than the one you don't" sort of thing. Also, when his competition is openly dismissive of 47% of the population, has no solutions for any real-world problems, and has a LONG, robust history of changing every one of his positions just for political gain, it's pretty difficult to lose.
I think the idea that Barack Obama reaped only benefits from being black is incredibly silly indeed. Political dialog is ugly in this country no matter who one is talking about, but the belief that he was literally not born in this country and is not the religion he says he is remains pretty well unique.