At the risk of sounding like Captain Obvious, representatives for each state are apportioned based on each 10-year census. There's actually a mathematical formula involved that, until just now when I went to look it up, I never knew existed.
Each state gets 2 electoral votes for the state senators, plus 1 for each congressional district. California has 53 congressional districts, Texas has 32, while Wyoming has 1. D.C. got its 3 electoral votes via the 23rd amendment.
There will be a new electoral map for the 2012 presidential election...early predictions of the 2010 census are that Texas (+4), Arizona (+2) and Florida (+2) will gain the most, while Ohio (-2) and New York (-2) will lose the most. This should make sense since people are moving to the South and West in droves. Louisiana is the only southern state projected to lose a representative and that will likely be due to Katrina relocation.
The electoral college isn't perfect, but straight popular vote would really limit it to a few states that would matter (and wouldn't have made a difference this time around)...I'll not lose a whole lot of sleep over it. I did my part and protected my right to bitch later if I feel like it.