The supermarket industry is in flux. It has long attracted investors because of its defensive nature: No matter what the economy is doing, people will need to buy food. But it has always been a challenging industry with low profit margins, though those margins can be OK if there's high volume. On top of that, the grocery landscape has been shifting, featuring consolidation as well as intensifying competition from discount retailers and club warehouses, among others.

Here's a look at some of the big players, how they've been faring lately, and which one is the most promising candidate for your portfolio.

Safeway (NYSE: SWY) is one supermarket chain that you won't be able to invest in for long, as it's being acquired by private equity firm Cerberus Capital in a $9.4 billion deal. Cerberus already owns the Albertsons supermarket chain, and tried to snag Harris Teeter, too, in 2013. Together, Safeway and Albertsons will sport some 2,400 stores, 27 distribution facilities, and 20 manufacturing plants. (Kroger (KR 1.80%) was also interested in buying Safeway, and pursued  it. Kroger did succeed in buying Harris Teeter, however.)

Safeway stock has appealed to investors for various reasons in recent years. For one thing, its dividend yields about 2.7%, and that payout has doubled over the past four years. The last increase, announced this month, was 15%. Safeway's first quarter featured revenue up about 1% year over year, a bit below analyst expectations. Same-store sales, for non-new locations, rose 1.8%. Net income became a net loss, in part due to higher costs (mainly in produce, meat, and pharmacy items) and acquisition expenses. On the plus side, management noted that sales of organic and natural items are growing twice as briskly as other items.

Speaking of organic and natural items, Whole Foods Market (WFM), dominant in that realm, has long enjoyed fatter profit margins than those of its more traditional grocery peers. That's changing, though, as others are aiming to steal market share from it. Wal-Mart, for example, has become a significant organic food seller, and Kroger has Fresh Fare Market stores, offering a Whole Foods-like experience. In response, Whole Foods has been lowering some of its prices. That might hurt its bottom line, but it could draw more traffic, boosting its top line.

Whole Foods posted mixed results for its last quarter, with revenue rising 10% year over year, as it did in the previous quarter, but earnings per share coming in flat and below Wall Street's expectations. Management has lowered its projections for the year, too. Still, the company has a lot going for it, such as positive employee morale and much fatter profit margins than its rivals', along with steeper sales per square foot.

Then there's Kroger, the nation's biggest supermarket chain. It has been performing well for quite a while, posting same-store sales growth for more than 40 consecutive quarters. Known for being customer-friendly, it's improving its checkout speediness, and is developing grocery-delivery services as well. The company is even branching out from traditional supermarket fare, introducing an array of items such as clothing and shoes in some locations.

Which of these companies is most promising for your portfolio? It really comes down to Kroger versus Whole Foods, and both seem like promising picks for patient long-term investors. Whole Foods has a steeper forward-looking price-to-earnings ratio, at 21, while Kroger's P/E is just 13.5. Both P/Es are well below their five-year average levels. Both companies offer similar dividend yields, too, between 1.3% and 1.4%. Whole Foods has an edge as it's growing more briskly, while Kroger has its growing size and momentum on its side.