Starbucks (SBUX 1.00%) and Dunkin' Brands (DNKN) show up on your radar when you are searching for your morning coffee, but should they be on your radar when you search for new additions to your portfolio?

Both of these coffee restaurants are well-run, and since Dunkin' Brands' initial public offering in 2011 both of these companies have beaten the market handily.

SBUX Chart

SBUX data by YCharts

How have they both done this, and how will they continue to beat the market?

Competitive advantages
Durable competitive advantages are investors' best friends. A strong, easily recognizable brand provides a huge competitive advantage for both Starbucks and Dunkin'. Their respective logos stand for quality, comparability, value, and much more.

When you stop in or drive through a Starbucks or Dunkin' store, you know the product you order will be served just like it had been served at any other Starbucks or Dunkin' store you've visited. You also know that you will be able to get in and out quickly and that you will receive reliable service from either store. These advantages go a long way for a consumer who is in a rush in the morning or who is in an unfamiliar area. Starbucks and Dunkin' have very loyal customers who would be hard-pressed to give up their morning coffee stops.

Another advantage both of these companies share is the sheer size of their operations. Starbucks has nearly 20,000 stores globally, which includes over 13,000 in the United States.  Dunkin' has almost 11,000 of its namesake Dunkin' Donuts stores globally, as well as just over 10,000 Baskin-Robbins ice cream shops globally . Consumers never have to look too far for either of these companies' shops.

Indicators of strong businesses
Strong businesses that use their competitive advantages typically have higher net margins, higher returns on equity, and steadier earnings growth than other companies.

The net margin provides one measure of the efficiency of a company. Dunkin' had a net profit margin of over 20% in 2013, and Starbucks had a net margin of over 11% if you ignore the effects of a lawsuit settlement that wiped out most of the company's 2013 earnings.  Both of these figures are much stronger than those you will find in average businesses in commoditized industries. Dunkin' and Starbucks differ because of their business models. Dunkin' runs a nearly 100% franchised model which results in higher margins, while Starbucks maintains ownership of most stores.

Both Dunkin' and Starbucks pass the test on another measure of efficiency, return on equity, as well. Over the three years in which Dunkin' has been publicly traded, the company has averaged an over-30% return on equity. Starbucks, on the other hand, has also fared well with an average of around 23% over the last ten years. Strong returns on equity show us that the companies' management teams can effectively reinvest the companies' retained earnings.

Lastly, we obviously want to see growth from the companies in which we invest. Dunkin' increased its revenue from $538 million to $714 million between 2009 and 2013, and earnings in the same period have increased 33% per year as they went from $35 million to $147 million. Starbucks' revenue has almost tripled in the last ten years from just over $5 billion in 2004 to nearly $15 billion last year. Starbucks' earnings have been growing as well. In 2004 Starbucks earned $392 million, and ignoring the effects of the lawsuit settlement that won't affect business moving forward, last year the company earned approximately $1.7 billion.

Why to buy premium coffee makers
The market has realized that both of these companies have strong competitive advantages and that they are well-run businesses, as it has currently priced Starbucks at 33 times earnings and Dunkin' at 38 times earnings. These valuations compare with the industry average of 28 times earnings and the market average of 18 times earnings.

These premiums to market valuations may be too high for some, but these are very intriguing companies. Starbucks has a long history of innovation, a management team known for their problem solving abilities, and an incredibly faithful customer base.

Dunkin' Brands is also a unique company. Nearly 100% franchised, it does not spend lots of money to invest in new restaurants, and franchisees actually pay the company to open more of its restaurants. Also, because it mostly has franchised restaurants, Dunkin' collects a percentage of the restaurants' sales for franchise and advertising fees, and the company is not as susceptible to operating inefficiencies. It is also of note that Dunkin' screens a potential franchisee for applicable business experience before it allows a franchisee to run a business under its brands.

Both Dunkin' and Starbucks are great companies. At these valuations they may take a little breather and let the market catch up a bit, but over the long run you can be confident about strong performance from these companies. Investing in both of these businesses could help you diversify as you take advantage of this growing industry.