The result of the U.S. election hangs not on the total number of votes received by each candidate, but rather how these translate to the electoral college votes allocated to each state. If, for example, the Republican candidate were to get the largest share of the popular vote in Florida, they would receive 29 electoral college votes towards their overall goal of reaching the 270 threshold for victory.
The way the votes are distributed is a matter of contention, however. States such as California and Texas may have a large number of votes - 55 and 38 respectively - but when compared to the amount of people living there, the 'weight' of each citizen's ballot is technically less than that of somebody voting in Wyoming, for example. Lending some figures to this, around 700,000 Californians share one electoral college vote, compared to just 200,000 Wyomingites.