Candidate could be elected even though they lack the majority of votes
There are a few ways that this could happen, and has happened.
1. During the election of 1824 the United States was divided politically. Three main candidates were seeking office, due to this the electoral votes were split amongst 3 candidates and no candidate had the required votes to win. This defaulted the decision to the HoR. They chose John Quincy Adams, who actually had less popular and electoral votes than Andrew Jackson.
2. One candidates support may be heavily concentrated in a few states. This was the case in the 1888 presidential election Benjamin Harrison won the presidency by receiving 233 electoral votes. He had fewer popular votes than his opponent Grover Cleveland.
3. The 2000 Presidency was won by George Bush, even though Al Gore had more popular votes.