The year was 1978. The place: Austin, Texas. That's when a young man named John Mackey and his girlfriend decided to strike out on their own and start a health-focused grocery store.

That store would eventually become Whole Foods Market.

The original employees of the first Whole Foods.

Image source: Whole Foods

While the journey to nationwide chain was bumpy, the basic idea at the foundation of it all remained unchanged: healthy, sustainably sourced food is good for all stakeholders -- customers, employees, management, and the environment.

It was a brilliantly forward-thinking idea that most people ignored for three decades. And while the execution of that idea was hamstrung by the Great Recession, the overall results were resoundingly positive. Comparable stores sales (comps) -- the key metric to measure success in grocery stores -- were the envy of the industry, most of whom would have been happy with 3% growth.

Whole Foods Comps from 1992 to 2012

Data source: SEC filings

But starting in 2012, something unexpected started happening. Other grocers began catching on to Whole Foods' game. In the blink of an eye, the competition caught up. Not only were there smaller specialty players like Sprouts Farmers Market, but big-box retailers like Costco and Wal-Mart built out their own organic brands.

Here's what that did to comps.

Whole Foods comps from 2012 to 2016

Data source: SEC filings

Over that time frame, the stock itself fell from $91 at the end of 2012 to just $28 in late 2016, a fall of almost 70%!

Where's the moat?

Whole Foods is a textbook case in the dangers of investing in a company without a moat. Otherwise known as a sustainable competitive advantage, a moat's effect is simple: it is that special force keeping customers coming back for more year after year, while keeping the competition at bay for decades.

There are four broad types of moats:

  • Network Effect: Each additional user makes the overall product better. Think of how each person that joins Facebook makes the platform more valuable.
  • High Switching Costs: The costs -- both financial and in terms of headaches -- of switching to a different provider are too high. Think of how Intuit's TurboTax stores all of your data from previous years, making filing taxes so much easier. 
  • Low-Cost Production: A company can provide a product or service for significantly less than the competition. Think of how Amazon's network of fulfillment centers makes quick delivery possible for less than others would pay for that ability.
  • Intangible Assets: This includes things like the power of brands (Apple), patents (any drug company), and regulatory protection (power companies).

Whole Foods was based on a brilliant idea, and while the execution may not have been "flawless", it was pretty darn close.

But take a look at the moat. Whole Foods has none. Perhaps an argument could be made for the brand, but even then, the results clearly show customers don't have allegiance to any grocery store.

The framework for how this plays out is:

  • Company A realizes potential in an idea that's not properly appreciated (organic food).
  • Company A exploits that idea and enjoys success (huge comps and rising stock).
  • Companies B, C, and D see this success, and start mimicking the idea.
  • The idea becomes commoditized, and prices start dropping. Good for consumers, not good for Company A (falling comps).
  • While Company A will be fine, its share price drops precipitously, as the high expectations baked in cannot be met (falling stock).

Where else is this happening?

Whole Foods is far from being alone in this predicament.

Another prime example is Casey's General Stores (CASY 0.71%). The company realized it was onto something by offering up in-house pizza at its convenience stores in locations across Small Town, USA.

Hands taking away pizza

Image source: Getty Images

Comps for the segment soared above 10% and shares boomed. But as the company expanded -- and as other players caught on -- those comps came back to earth. While Casey's operations will survive, investors are stuck with a stock that's flat over the past 28 months while the market has advanced over 25%.

High-fliers without a moat?

I am also cautious about two high-flyers that haven't seen competition encroach...yet. Both NVIDIA (NVDA 6.18%) and Arista (ANET -0.02%) have seen shares explode since February of 2016.

NVDA Chart

NVDA data by YCharts

The former's catalysts are its graphics processing units (GPUs), which are in high demand for gaming, AI, and cryptocurrency mining. The latter has gotten huge by making it easier for companies to analyze and speed up the transmission of data that they have.

Both are uniformly praised as leaders in their niches. But do a little digging and you'll see that neither has a discernible moat. That means one of two things will happen over time:

  1. Competition will offer a "good enough" solution at a lower price point, bringing the stocks back down to earth.
  2. There will be a core change in the business models to help build moats around the companies.

I'm not willing to short either company or give either an "underperform" rating on my CAPS profile because I have no idea when this expectation could come to fruition. I italicized the word expectation to differentiate it from a forecast. As former Fool Morgan Housel recently pointed out:

"An expectation is the belief that certain events will occur over time...A forecast is a complex attempt to merge expectations with the calendar...An expectation forces you to prepare for an inevitability without requiring near-term actions -- often counterproductive -- that forecasts push you toward. Try surrounding yourself with more expectations and fewer forecasts."

I don't know when the competitive reckoning that I predict could come true. Tesla recently announced it would start making its own GPU, and cloud giants like Amazon and Facebook have already said they'd like to design their own switches.

But when, if ever, could this be an actual threat to either company? Maybe next quarter...or five years from now. I have no idea. And if it's five years from now, shareholders will surely be rewarded with continued growth from both companies.

My uncertainty doesn't mean that you should shy away from the NVIDAs, Aristas, and Caseys of the world. Rather, it's a reminder that even a great idea, perfectly executed, is at risk of commoditization if there's no moat protecting the underlying business.

Invest accordingly!