Each State is allocated a number of electors equal to the number of its U.S. Senators (always 2) plus the number of its U.S. Representatives. The number of electors for a State is based on the number of members in the House of Representatives who represent the State, plus two for the State's Senators. A State's Congressional delegation is determined by the State's population.
The number of people in each State is determined by the Federal census, which is taken every ten years and includes a count of every State's population.