Yesterday, Whole Foods Market (WFM) announced its second-quarter earnings, stunning investors with a 7% increase in comparable sales and a 19% increase in earnings per share. Margins were strong, with operating margin hitting a historic high of 7.5%. The stock jumped 10% by midday.

The news was so good that Whole Foods' main national rival, The Fresh Market (TFM), got caught up in all the investor love, with its shares up 5%.

The lowdown on Whole Foods
Margin is the big headline for Whole Foods. The new high of 7.5% opened up the eyes of management, and on the earnings call, they discussed the new normal. Answering a question about the operating margin, co-CEO Walter Robb said: "We are not searching peak margin here. We are just continuing to operate our business and the results are coming as a result of that."

The point is that Whole Foods is managing its operations in a way that means there isn't some sort of mythical peak for it to hit. Interestingly, apparel retailer Fifth and Pacific recently discussed how the company felt like it had hit that peak, and now it was forced to trade off sales growth for high margins. Whole Foods doesn't seem to be in that boat, yet.

The increase in margin paired with an increase in comparable sales that set Whole Foods up to hit its prediction for a full year of 7% growth. This quarter's growth was still higher than expected, though, and the company raised full-year earnings-per-share guidance by a few cents, up to between $2.86 and $2.89. That would be at least a 15% growth in earnings per share, and another bit of great news for investors.

The competition
The Fresh Market is moving quickly, and it's pushing into California and Texas. Those markets have been part of Whole Foods for a while, and so far Whole Foods has been able to operate there without any big competitor. The Fresh Market is hoping that those new locations will be as profitable as its existing stores. Last quarter, the company managed to hit an operating margin of 8.3%.

Whole Foods still has a massive head start, with 348 stores compared with Fresh Market's 130 locations. But the increasing competition may have a detrimental impact on margins for both companies as they increasingly rub up against each other. But that's a very long-term view of the companies, and for now, they both seem to be thriving separately. Whole Foods has the upper hand, if only because of its size, but that strength costs money. Whole Foods has a higher P/E than the Fresh Market, but based on the results that the company puts up, it just may be worth it.