Q:

What happens to an index if one of its components fails?

This may seem like a contrived question, but from my perspective as a programmer, edge cases are everything.
Ignoring the sheer improbabilities involved, what would happen to an index (say, the S&P 500) in the situation where one of its components fails (that is, drops to zero in 1 trading day), and simultaneously, another company not in that index absorbs its market cap?
On a cursory examination of the question, from what I know, theoretically the index would appear unchanged once it gets rebalanced at closing, as the components should be fungible relative to the value of the index itself. But anyone who had the allocation of the index from the day prior would have lost money proportional to the market cap of the failed company and the market cap of all the companies in the index. Am I missing something here?

A:

Willis Group Holdings Set to Join the S&P 500; Fossil Group to Join S&P
MidCap 400; Adeptus Health to Join S&P SmallCap 600 notes in part for the S & P case:

Willis Group Holdings plc (NYSE:WSH) will replace Fossil Group Inc.
  (NASD:FOSL) in the S&P 500, and Fossil Group will replace Towers
  Watson & Co. (NASD:TW) in the S&P MidCap 400 after the close of
  trading on Monday, January 4. Willis Group is merging with Towers
  Watson in a deal expected to be completed on or about that date
  pending final conditions. Post merger, Willis Group Holdings will
  change its name to Willis Towers Watson plc and trade under the ticker
  symbol “WLTW”. Fossil has a market capitalization that is more
  representative of the midcap market space.

As of Jan. 8, Fossil is about $1.44B in market cap and Willis is $21.02B for those wondering. Apple with a market cap of $540.58B is 3.26% of the index making the entire index worth approximately $16,582.21B, so Fossil is worth .00868% of the overall index for those wanting some numbers here.
Thus, if a company acquires another and becomes bigger than there can be replacements made in those indices that have an artificial number of small members. Alternatively, a member may be removed for lack of representation where it is just so small compared to other companies that may be a better fit as some indices could be viewed as actively managed in a sense.
In contrast, there are indices like those from Russell, known for the Russell 2000 small-cap index:

Q: Why don't you reconstitute the indexes more often than once a year?
A: Maintaining representative indexes must be weighed against the
  costs associated with making frequent changes to index constituents
  (namely, buying and selling stocks).
The Russell Indexes are annually reconstituted because our research
  has shown that this strikes a reasonable balance between accuracy and
  cost. We originally reconstituted our indexes quarterly, then
  semi-annually, but found these options to be suboptimal. Our extensive
  research demonstrates that annual reconstitution accurately represents
  the capitalization segments and minimizes the turnover required to
  reflect the segments as they change.

Thus there can be different scenarios. 
Then there can be the effect on index funds when price-weighted indices like the Dow Jones Industrial Average has a member that does a stock split that causes some rebalancing too. On the DJIA Divisor:

The Dow Jones Industrial Average (DJIA) is a price-weighted index that
  is calculated by dividing the sum of the prices of the 30 component
  stocks (Dow Jones Industrial Average components) by a number called
  the DJIA Divisor or Dow Divisor . The index divisor is updated
  periodically and adjusted to offset the effect of stock splits, bonus
  issues or any change in the component stocks included in the DJIA.
  This is done in order to keep the index value consistent.

