When you buy an index fund, your investment gets weighted across many companies.
If some are delisted, the fund loses the money allocated to them, but not its whole portfolio. Then new companies are added to the index, and the fund's remaining assets get re-allocated to match the rules of the fund's underlying index.
If some are delisted, the fund loses the money allocated to them, but not its whole portfolio. Then new companies are added to the index, and the fund's remaining assets get re-allocated to match the rules of the fund's underlying index.