In investing, there's no such thing as a sure thing, but some stocks come pretty darn close. 

These are the types of companies that have consistently outperformed the market for years, if not decades; they have withstood challenges from competitors, demonstrated a set of competitive advantages that are hard to match, and are leaders in their respective industries.

In consumer goods, Starbucks (SBUX 0.53%) and Nike (NKE -1.26%) stand out as these kinds of buy-and-forget stocks, the ones that deserve a place in almost any portfolio. They have already delivered monster returns to early investors, but the good news is that they look primed for further growth over the next decade. Better yet, they have a combination of attributes that make them a good fit for almost any kind of investor, whether they're seeking growth, reliability, or dividend income. Here are three reasons why.

A man holding several $100 bills in his hands

Image source: Getty Images.

1. They've stood the test of time

Past performance is no guarantee of future success in the stock market, but it can be a pretty good predictor, especially when that record of performance is longer than a generation.

Since its 1992 IPO, Starbucks stock has returned more than 26,000%. Nike shares have appreciated more than 56,000% since they debuted in 1980. If you invested $1,000 in each company at their IPOs, you'd have more than $1 million today with dividends reinvested.   

More recently, both Starbucks and Nike have continued to beat the market, as you can see from the chart below, which shows their growth over the last decade.

SBUX Chart

SBUX data by YCharts

Not only have both stocks delivered great returns for long-term investors, they've also bounced back from a number of challenges over the years. A few years ago, Nike was losing market share to Adidas and Under Armour, but the company adjusted its strategy, launching the Consumer Direct Offense, which has accelerated innovation and direct-to-consumer connections. The company has been thriving since, thanks to innovative products like the controversial Vaporfly running shoes that was worn by the first sub-two-hour marathon runner, and directly engaging customers through experiential stores and its enhanced Nike and SNKRS apps.

Starbucks, meanwhile, was struggling around the same time as sluggish growth, a decision to close 150 stores, and a racial bias incident at a Philadelphia store combined to push the stock momentarily below $50 a share in 2018. However, since then, shares have surged, thanks to expanding delivery in China with the help of a new partnership with Alibaba and adding new menu items in the U.S., which has driven traffic higher. During the recession, Starbucks shares also plunged, but the stock bounced back as it closed underperforming locations and refocused its mission to be a "third place" for its customers.

Several Starbucks cups stacked awaiting pick-up.

Image source: Starbucks.

2. They each have huge brand strength

Starbucks and Nike are recognized around the world and have a degree of brand power that none of their rivals can match. According to Interbrand's ranking of the 100 best global brands, Nike comes in No. 16 with a brand value of $32.4 billion, while Starbucks ranks No. 48 and has a brand value of $11.8 billion, up 23% from the year before.

Their big brands have given each company advantages that competitors can't match. Starbucks, for example, has 17.6 million rewards members in the U.S., giving the company a leg up over independent coffee shops and corporate chains like Dunkin' Brands. Its app-driven programs like mobile order and pay have further reinforced that edge. The size of its brand and footprint also gives Starbucks significant mindshare. If you're away from home, especially in an unfamiliar place, and want a coffee or something similar, you'll probably think of Starbucks. Similarly, if you're considering purchasing athletic footwear or apparel, Nike is likely to come to mind.

Nike has leveraged its brand strength into an unbeatable collection of sponsors, including icons like LeBron James in basketball, Serena Williams in tennis, and Cristiano Ronaldo in soccer. Its marketing machine and industry leadership make it the most attractive partner for top athletes, creating a virtuous cycle that should continue into the next generation, turning many of the next top stars into Nike partners.

Perhaps the best way to measure each company's brand strength is to compare them to their closest rivals. Starbucks is valued at $107 billion, while Dunkin' Brands is worth just $6 billion. The second-most valuable publicly traded coffee chain is actually Chinese start-up Luckin Coffee, currently worth $11 billion, though it's unprofitable and has less than $1 billion in annual revenue right now.

In sportswear, Nike today is worth $158 billion, more than double Adidas's $71 billion market cap.

Unlike industries such as tech, consumer brands tend to be stable, enduring from one generation to the next, and disruption is relatively rare. Starbucks' and Nike's closest competitors -- Dunkin' and Adidas, respectively -- are actually older than they are. In other words, the biggest companies in these categories have been around a long time, giving investors another reason to count on Nike's and Starbucks' staying power.

Two people playing basketball inside a Nike store

Image source: Nike.

3. They're well-positioned for continued growth

While both Nike and Starbucks are well-established brands, they are still delivering impressive growth and have promising growth paths ahead of them. For example, in China, the world's biggest and fastest-growing consumer market and a brand-conscious one as well, both companies have demonstrated their prowess. Nike has seen currency-neutral growth of 25% in China through the first half of the current fiscal year, thanks to strong digital sales and the popularity of its signature sneakers.  

Starbucks is opening about 600 stores annually in China and saw comparable sales growth of 4% there last year. Total revenue in China rose 14% in its most recent quarter, and the company aims to increase its store base by about 15% this year, which should drive another strong round of top-line growth. 

Elsewhere, both companies have brought in CEOs with a tech background to lead them through their next stages. Starbucks and Nike have both differentiated themselves from competitors with their embrace of technology and innovation. Nike has seen strong growth from its digital initiatives, especially the Nike and SNKRS apps recently, while Starbucks has set the mobile payments' standard in restaurants with its app, rewards program, and mobile order and pay. Now, delivery appears to be the next frontier for the java giant.

As technology evolves over the next decade, both companies should be ready to capitalize on new opportunities as they arise.

Finally, the categories they operate in are both stable and growing. Demand for coffee and athletic gear is not going anywhere, and both will benefit from the expanding middle class in parts of the world like China and Latin America.

A man sitting in front of a laptop holding his hands to his mouth and looking pensive.

Image source: Getty Images.

What it all comes down to

Starbucks and Nike both trade at modest premiums compared to the S&P 500 today, based on their P/E ratios, but that's natural considering their brand power and competitive advantages.

The two stocks are also dividend payers. Starbucks offers a 1.8% yield while Nike pays 1%, and both look poised to become Dividend Aristocrats in the future. Though their yields may not be enough to attract income investors, both stocks have stood out for their commitment to dividend growth. Nike has raised its dividend every year since 2004 and by double digits annually during that span, except for the financial crisis years in 2008-2009. Starbucks initiated a dividend in 2010 and has increased it by at least 14% every year. If that track record holds up, investors can count on these dividends to at least triple over the next decade.

These two stocks won't be the biggest winners on the market over the next 10 years, but for investors looking for a combination of growth, income, and safety, it's hard to find a better choice than Starbucks or Nike. As the 2020s kick-off, both stocks look set to outperform for another decade.