First, who is winning the presidential race? We don't know. Some polls show the race closing to within the margin of error. Others show Obama's lead widening. What's going on?
First, all of these results are within the margin of error, especially if you assume that McCain is slightly behind. But polling gets complicated quickly.
If you just call 500 people then you will get a result but it might be a bad one. A lot of people don't vote so you have to identify the likely voters. Your sample group is likely to be too small to really represent a cross-section of America so you have to do some weighting. This is the toughest part.
Lets assume that Democrats and Republicans make up 30% of the population each with the remaining 40% uncommitted. If your poll of 500 people was a good cross-section then you would have 150 for each party with the rest uncommitted. If your group actually had 200 Democrats and 100 Republicans then you have a problem. Your sample group is going to lean for Obama.
What the pollsters do is to estimate the proportion of voters in each party then weight the sample to match that. With the example I gave above, they would multiple the Republicans' answers by 150% and the Democrats' answers by 75%.
But, party identification has been fluid the last couple of years. In 2004 the parties were closer to parity. Republicans defected to the Democrats in 2006. It appears that this trend increased during the primaries this year but this may not be accurate. McCain clinched the primary early on. Many Republicans switched parties in order to be part of the Obama/Hillary contest. They may come home to McCain. No one knows.
Then there are "undecideds" who always vote for the same party but refuse to register with a party. In the last few elections the number of swing votes has been less than 20% of the electorate. It is hard to identify this group.
On top of that, an increasing number of people no longer have land lines and pollsters do not call cell phones.
Then there are people who say that they will vote for Obama because they worry about being labeled a racists.
Put it all together and the actual margin of error is probably higher than the pollsters are admitting.