It is a federation of States, not a single State. Each one has its weight as State relative to the federation. So it is not "the people" who vote for the president. It is the people who vote whom their State will vote as president.
Due to the way the electoral college gives small population states more electoral votes comparatively, votes in small population states have more weight.