Most index funds, including VTSAX, are weighted by market capitalization.
The market capitalization of each stock is simply the number of shares outstanding multiplied by the stock price.
The market capitalization of the index is simply the sum of the market caps of all the individual stocks that make up that index.
Each stock in an index fund is held in an amount proportional to that stock's market capitalization compared with the total market capitalization of the whole index.
So as a random example, if Microsoft's market cap is 5% of the market cap of the total of all funds in the index, then the fund would invest 5% of their assets in MSFT.
As the relative proportions of the market caps change, the mutual funds adjust their weighting. However, note that a lot of this is take care of automatically. If Microsoft's stock price were to double tomorrow, then it's market cap would then be closer to 10% of the index. But the shares of MSFT that an index fund holds today would double in value tomorrow as well, so would similarly represent 10% of their holdings. It's not like the doubling of the stock tomorrow would cause the index fund to have to go out and double the amount of shares that they own.