In Q3 whole foods made 3,725 with a gross profit of 1,268 representing a profit margin of 34% and their current P/E ratio is around 35, Amazon for context has a P/E ratio of 240 at time of writing.
This means, that amazon can reduce the price of food by quite a bit and keep their investors happy. Amazon, based on the comparison between the two companies P/E ratio, can cut that profit margin by a factor of 7, meaning whole foods fits perfectly within amazon's model (unless they were to direct profits elsewhere), with the ability to reduce their prices there by 25% on average (representing a billion of dollars returned to consumers).
However, with such a price reduction, it's very possible that whole foods could become a mass market grocery store, while keeping it's current brand prestige. Additionally according to http://www.businessinsider.com/how-much-more-expensive-is-wh... the prices are really only 15% more than normal grocery stores, so amazon can choose to keep even more of the profit that they could afford to return to their customers (by investment standards) while also still undercutting the competition.