Many companies featured on Money advertise with us. Opinions are our own, but compensation and
in-depth research may determine where and how companies appear. Learn more about how we make money.

Money is not a client of any investment adviser featured on this page. The information provided on this page is for educational purposes only and is not intended as investment advice. Money does not offer advisory services.

Coffee spilling
Gazimal—Getty Images

When Dunkin' Donuts began selling lattés and other premium coffee drinks around a decade ago, it was viewed as a direct attack on Starbucks, the nation's leading specialty coffee chain.

Then five years ago, another front broke out in the java wars when McDonald's formally launched its McCafé line of premium coffee drinks. At the time, Mickey D's entry into this brewing battle was called "a game changer" — and not in a good way for Starbucks.

The pincer moves were seen as a real threat to the Seattle-based java juggernaut, especially given the economics of the time. In 2009, the economy was still mired in a recession stemming from the global financial crisis. And with unemployment hovering near 10%, conventional wisdom said that cost-conscious consumers were likely to make a shift away from Starbuck's pricey menu toward more cost-conscious offerings found at McDonalds or Dunkin'.

Research, in fact, showed that while coffee purchases were relatively recession proof — if you have to have your morning fix, you have to have your fix — the amount of money consumers were willing to spend per visit was likely to fall in economically troubled times. Hence, McDonald's and Dunkin', which both cater to working- and middle-class households, saw an opening.

Yet if the past five years have taught us anything, it's that conventional wisdom was wrong.

As the chart below shows, over the past five years, Starbucks' same-store sales — that is, revenues at locations that have been open for more than a year — accelerated and far outpaced those of Dunkin' Brands, parent company of Dunkin' Donuts.

This point was reinforced when Starbucks announced its latest quarterly results on Thursday, which showed better-than-expected profits, and an 11% jump in overall revenues versus the same period last year.

What gives?

Well, class may indeed be playing a role in the coffee wars — but not in the way that you may have assumed. Earlier this year, Ted Cooper at The Motley Fool made an astute point:

And who owns that crowd? Dunkin' Donuts, of course, which despite its name generates nearly 60% of its revenues from coffee and beverage sales, not doughnuts.

The fact that Dunkin's same-store sales growth pace has sunk precipitously ever since McCafés hit the market — even as the economy improved — is likely due to McDonald's marketing push for bargain-seeking coffee drinkers. In many markets, in fact, McDonald's is offering any size hot coffees for $1, which is more than half off what Dunkin' charges for a hot regular cup of Joe.

Not surprisingly, investors have caught onto the fact that McDonald's and Dunkin' may be hurting one another — and not Starbucks — as evidenced by recent moves in Starbucks (SBUX), Dunkin' (DNKN), and McDonald's shares:

SBUX data by YCharts

The Economy Strikes Back

Meanwhile, the premium status that Starbucks maintains is likely to work to its advantage as the economy improves.

For instance, Dunkin' Donuts recently announced that it will have to raise its prices slightly to address skyrocketing coffee bean prices in the commodity market. It remains to be seen how those price hikes will affect its consumer's purchasing habits.

At Starbucks, it's already known how consumers will react. When the company announced a price hike in 2013, comp-store sales remained strong as consumers cherished the brand enough to pay up, even in a so-so economy. The company announced another price hike in June, which is likely to add to overall revenues going forward.

The Empire Strikes Back

Ironically, the difficulties that McDonald's and Dunkin' Donuts have run into in their attempts to strike at Starbucks has created an opening for Starbucks to attack those competitors where they live — in food sales.

Starbucks' chief financial officer Troy Alstead noted that in the company's recently ended quarter — when same store sales rose 6% globally and 7% in the U.S. — two percentage points of those comp sales growth was attributable to food sales.

Starbucks' momentum in food has recently been driven by increased lunch offerings, but going forward, the full effects of the company's 2012 purchase of La Boulange bakery should start showing their effects.

In a conference call with analysts Thursday, CEO Howard Schultz noted that La Boulange branded baked goods are now available in more than 1,000 Starbucks stores in California and the Pacific Northwest. By the end of this summer, that number should jump to more than 2,500 stores, he said, as La Boulange food items will be sold in stores in New York, Los Angeles, Chicago and Boston.