In over-simplified terms, the people of America do not elect the President, the States do. Each state is given a number of votes in proportion to the number of people that it has in relationship to the other states in the country. Then, which ever candidate gets the mosts votes in a state, they get ALL of the votes from that state.
For example, Texas has 34 electroral votes and California has 55. Let's say voting is fierce Bush gets 1,000,001 votes in Texas and Kerry gets 999,999. Bush would be entitled to all 34 of Texas's electroral votes.
Then let's say that it LOOKS like Bush has the election in the bag and voters in California decide to stay home. Let's say Bush gets 2 votes in California and Kerry gets 3 votes. Kerry would win in California and get all 55 of their electroral votes.
Kerry would have 1,000,002 popular votes (999,999 + 3) and Bush would have 1,000,003 popular votes (1,000,001 + 2) but Kerry would be in the lead with 55 electroral votes and Bush behind with 34 electroral votes.
That might be oversimplified but that's the way it works.