VTSAX uses the CRSP US Total Market Index. At http://www.crsp.com/indexes-pages/crsp-us-equity-indexes-methodology-guide you will see a download named "The CRSP U.S. Equity Indexes Methodology Guide" as well as highlights showing the goals, several of which are related to weighting (allocation):
- Breakpoints based on cumulative market capitalization
- Partial weighting
- Investability screens
- Float-adjusted market cap
The 61 page PDF has all the rules for which companies' stocks are included in the index and how they are weighted.
There is no generally applicable answer, each index fund uses an index constructed by a market research firm (generally distinct from the fund management team, if it weren't distinct you'd tend to label the fund as active not index), and each index has its own rules, which may be public as the above CRSP index, or may be shown only to subscribers (fund managers).