Source:  Starbucks

It sounds counter-intuitive at first. How could Starbucks (SBUX -0.35%) and Dunkin' Donuts (DNKN), both of which realize the majority of their sales and profits from coffee, actually benefit from higher coffee costs? In addition to the obvious answers, less-obvious answers exist that most people overlook.

The more-obvious reasons why these costs won't hurt
First, coffee chains like Dunkin' Donuts and Starbucks can adjust their own prices based on inflation and pass the extra costs onto consumers. For example, on June 10, Dunkin' Donuts stated that it expects "modest increases in coffee prices" in reaction to a spike in the cost of the beans.

This comes after a 90% rally in global coffee prices between January and April of this year due to drought concerns in Brazil that made growing the crop more challenging. Packaged coffee distributors that sell Dunkin' Donuts coffee in stores responded earlier in June by increasing their prices by 9%.

Source: Dunkin' Brands Group

Second, in order to make their costs more predictable, Starbucks and Dunkin' Donuts engaged in complex hedging contracts which essentially bet that coffee prices would rise. As a result the profits generated from the "bets" offset the cost increases and locked in specific contracted prices. This is similar to what the airline industry does with fuel.

Third, the beans themselves barely cost any money in the first place relative to the price that these companies receive for coffee. For Starbucks, the cost is less than $0.10 on the dollar or a 900% markup. You know how cheap it is to brew an entire pot at home -- a fraction of the cost of one cup at Starbucks and Dunkin' Donuts -- so you could probably only imagine how cheap it is for those guys. And they don't pay retail like we do.

A less-obvious reason
The less-obvious reasons are simply mathematics and economics. Even the mom and pop coffee chains that don't engage in complex coffee bean cost hedging could benefit. First part is the simple fact that coffee on the retail level is extremely inelastic in part because it's so cheap in the first place in the big scheme of things.

Few of us will skip out on a much-needed $1 to $2 cup of Joe from Starbucks or Dunkin' Donuts in order to save money in the first place. (Yes, plain ole regular coffee is still within that cheap range). We're probably not going to pop into either one, see that the price has gone from $1 to $1.20 or from $2 to $2.40 and say, "That's too much, I'm out of here!"

As an example, at one point in Starbucks history the company raised the price of mocha by $0.25 and regular coffee by $0.10. The Sacramento Bee reported on the response to the price hikes "...in testament to Starbucks' mastery of the gourmet coffee scene, customers barely flinched, the espresso machines kept s-s-sissing..." You'll have to pry my cup from my latte-warmed dead fingers as well.

Source: Starbucks

Even less obvious, perhaps...
Remember that I mentioned that Dunkin' Donuts and Starbucks are hedged and protected from coffee price increases? Yeah, but that doesn't stop them from passing the "cost" onto consumers anyway. A cost that doesn't exist. Which means more money in both companies' coffers.

What's worse for consumers is that often the headlines just act as the perfect excuse for Dunkin' Donuts and Starbucks to raise prices -- permanently. For example, Starbucks raised prices in 2013 by an average of 1%. During much of the same year, actual coffee bean prices got crushed by as much as 29%. Did Dunkin' Donuts and Starbucks respond by lowering their prices? Of course not.

The takeaway here is not to fear global coffee prices when you analyze the fundamentals of your favorite coffee and pastry chains. If anything, cheer for rising costs.