The electoral college is a weird vestige of an earlier time. Each state gets apportioned a vote equal to the number of senators and congressmen they get; so the least populous states get an outsized voice in appointing a President.
When the law to cap the size of the US house to 435 representatives was passed in the very early 1900s - the US population was only ~90m. If instead the size of the elected body was allowed to grow in line with population, the US would have something closer to ~1,600 representatives currently, and as a result the electoral college would be much more equitable.