In America, the people don't elect the president. The states send electors to Washington and all the electors form the "electoral college". It is this electoral college that elects the president. To make it a bit democratic, each state holds a vote to see who the residents of the state want as president. The electors that state sends to Washington will be told who they should elect based on who the residents of the state voted for.
A simple example. Imagine the US only has two states: New York and Florida.
New York has 19 million residents and gets to send 28 electors to the electoral college. Florida has 22 million residents gets to send 30 electors to the electoral college.
All 19 million residents of New York vote for Kang. New York sends 28 electors and tell them they should elect Kang. In Florida, the vote is split. 12 million vote for Kodos and 10 million vote for Kang. Since more people voted for Kodos, Florida sends 30 electors and tells them to elect Kodos.
The popular vote is 29 million votes for Kang and 12 million votes for Kodos. The electoral college votes are 30 votes for Kodos and 28 votes for Kang. Kodos wins even though 70% of Americans voted for Kang.