Why Texas has less electoral votes than California?

Electoral votes are equal to the number of senators and representators a state has. Each state is given the same number of senators: 2. However, the number of represenatives differs because it is based on population; the more populated states have more representatives. California has about 12,000,000 more residents than Texas, which means California has much more representatives. This then adds to the number of electoral votes, pushing California ahead of Texas and all the other states.