Let’s just say that there are just two States in the Electoral College.
State 1 has 51 Electoral Votes and a population of 1020.
State 2 has 50 Electoral Votes and a population of 1000.
511 vote for Candidate A and 509 for Candidate B.
Candidate A gets 51 EVs. Candidate B gets 0 EVs.
0 vote for Candidate A and 1000 vote for Candidate B.
Candidate A gets 0 EVs. Candidate B gets 50 EVs.
So totalling it…
Candidate A wins with 51 EVs and just 511 votes.
But Candidate B loses with 50 EVs despite getting 1509 votes.
So Candidate B lost the Electoral College despite getting a whopping 75% of the popular vote!
Now America has 50 States and a couple of them even had split EVs to complicate matters and make it really complex, but the basic philosophy is as mentioned above.