Two forces are at work to make election outcomes known quickly. Of course these only work when the voters actually make a clear selection with their votes. In the cases where the voters are unclear because of a nearly equal number of votes for two candidates for the same office, then the system fails to find a quick solution.
After the fiasco in the presidential election of 2000, the USA decided it would get rid of punched card voting systems. In my county, the punched card system was replaced with a new optical scan paper ballot system.
This new technology allows for ballot processing before election day. When the time comes to actually add up the votes (which cannot be done before the polls close), all the hard part is already done and the results for those ballots already prepared are nearly instant. Our county decided to go to all mail (i.e. optical scan) ballots because of the unintended consequences of the federal law demanding replacement of punched card ballots. I won't go into the details if I can avoid it, but the all mail ballot approach we chose meant we have nearly instant results within minutes of the time the polls close. We don't have all the ballots counted at that point, but we do have all the ballots received by the morning of election day counted. The remaining ballots dropped into collection boxes on election day and those post marked on election day or before will all be counted within a few days. Still, we knew the results from approximately seventy percent of all voted ballots shortly after the polls closed. These results are enough to indicate the outcome of most of the races taking place.
The second force at work is the ability many experienced election observers have to project the outcome of a race with a relatively small number of ballots known. This uses well established trends for each election district to make an educated guess how the remaining ballots will come out given knowledge of the first ballots results. It turns out that each election district has a history of Republican vs. Democrat preference. It is also known that the ballots processed later (after election day) will trend a certain way for a given election district. In cases where the first ballots counted give a moderate lead to one candidate, it is pretty easy to guess how the final vote count will come out a few days later.
Let me give a couple of examples for my election district - Clark County, WA.
In one race for County Commissioner, there were two Republican candidates running against each other and no Democrat on the ballot. The leader received 60 percent of the votes counted at the close of election day. It is clear to everyone that he will win the race when all the votes are counted.
In another race for State Senator, the Republican was behind the Democrat by only 200 or so votes out of 35,000 cast for that position. The outcome of this race seems to be in doubt, but the experience in this particular voting district is the later ballots will always favor the Republican. Republicans in this district tend to vote later than Democrats. That means this Republican will probably win the election even though he is behind by a small margin after the first ballots are counted.
In general, any candidate with a two percent lead after the first ballots are counted will win.More questions on 2012 U.S. Presidential Election: