What happens to your money if you invest in an index fund and companies drop out of the index?
Index funds typically rebalance quarterly, I believe. The index also rebalances, usually called reconstitution [1]; the Russell indexes rebalance yearly, for example.
Which means there can be a discrepancy between the fund and the index at any given time. This can result in arbitrage opportunities, I believe.
Interestingly, the selling and purchasing involved in adding or removing a stock from an index/fund also has an effect on the market [2].
[1] https://www.investopedia.com/terms/r/reconstitution.asp
[2] https://www.cxoadvisory.com/miscellaneous/strategies-for-exp...
When a fund rebalances, it has tax consequences, so funds are incentivized not to do it.