While many Americans feel as if they vote directly for a
presidential candidate on election day, they actually vote for
electors: individuals who vote in the electoral
college. The total electoral vote, not the popular vote,
actually determines the winner of U.S. presidential elections.
Generally, all the electoral votes in a state are awarded to that candidate who wins the popular vote. Hence, a majority or plurality of the voters in Alabama, for example, will vote for either the Democratic or Republican (or a third-party) candidate; that winning candidate in Alabama then generally receives all of Alabama's 9 electoral votes. The total number of electoral votes is 538, so that, if no third-party candidates wins in any state, a candidate must get at least 270 total electoral votes to be elected President.
The number of electoral votes held by each state, depends on the relative size of the state's population. Therefore, well-populated states, such as California, Texas, and New York are highly important because they have so many electoral votes (California has the most with 54).
It is technically possible for the candidate without the most popular votes to receive the most electoral votes, and therefore be elected President even though more actual voters chose a different candidate, but this scenario has happened only a couple of times in history, and never in this century. If this scenario were to happen in the modern era, the seeming injustice would undoubtedly lead some to call for a constitutional amendment to reform U.S. voting procedures in the future.
Until such an event, most Americans seem content with their unique electoral college system which, among other things, ensures that the outcome is determined rather quickly on election night as millions follow each candidates' climb to the 270 threshhold. Americans pay little attention to the electoral college, which meets much later, and is assumed to essentially "ratify" the outcome.
To better understand how the system works, see The Electoral College