Amazon bought Whole Foods for $13.7B, but Whole Foods' market capitalization jumped to $17.6B. How are the shareholders of Whole Foods going to ultimately compensated? Do their shares turn into cash, and if so, why is there a discrepancy between the sale price and the market capitalization?
Short answer: google finance's market cap calculation is nonstandard (a.k.a. wrong).
The standard way of computing the market capitalization of a firm is to take the price of its common stock and multiply by the number of outstanding common stock shares. If you do this using the numbers from google's site you get around $13.4B. This can be verified by going to other sites like yahoo finance and bloomberg, which have the correct market capitalization already computed.
The Whole Foods acquisition appears to be very cut-and-dry. Investors will be compensated with $42 cash per share.
Why are google finance's numbers wrong for market cap? Sometimes people will add other things to "market capitalization," like the value of the firm's debt and other debt-like securities. My guess is that google has done something like this. Whole Foods has just over $3B in total liabilities, which is around the size of the discrepancy you have found.