Image source: Getty Images.

It's been a rough year to be a retailer. Major department stores like Kohl's and Macy's have all reported weak results recently, causing their stocks to take a hit. Even premium retailers like Nordstrom and Tiffany & Co. saw their same-store sales decline in the first quarter. These results are a bit puzzling when you consider that the unemployment rate is low and gas prices are cheap. So what's causing the disconnect?

One likely contributor to these retailers' pain is the increased competition from Amazon.com (AMZN -1.14%). Last quarter Amazon's product sales grew more than 20% to $20.5 billion, showing that the company continues to gobble up retail market share. That fact should worry any investor with money devoted to the retail sector, especially now that Amazon.com is preparing to expand its one-hour delivery option across the country.

However, not every retailer is equally threatened by the continued rise of Amazon.com. In fact, I'd argue that one retail giant -- CVS Health Corp. (CVS 1.15%) -- is very well protected from Amazon.com's continued growth.

Below are three reasons why I believe that CVS Health's business is as close to Amazon-proof as it gets.

1. 67% of CVS Health's revenue isn't related to retail at all

Most consumers think of CVS Health as just a operator of retail pharmacies, but that's only a part of the story. CVS Health's revenue actually comes from two distinct business segments -- its retail store empire and a pharmacy benefit management (PBM) business. Believe it or not, it's the PBM business that drives the lion's share of the company's revenue.

So how does the PBM business work? In exchange for a small fee, CVS Health manages the pharmacy benefits that large institutions -- governments, companies, unions, and more -- offer to their employees or members. Since CVS Health has a deep knowledge base in the pharmaceutical industry and enormous bargaining power, it's in a great position to help these institutions rein in their pharmaceutical spending.

CVS Health's PBM business currently has around 80 million members under its umbrella, which is a huge competitive advantage, since this business is all about scale. As the company's member base continues to grow, so will its bargaining power over drugmakers, creating an advantage which even almighty Amazon.com would find tough to assail (assuming Amazon even wanted to get into this business in the first place).

CVS Health's PBM customers are also an extremely loyal bunch. The company boasts a customer retention rate of 97.3%, which is an absurdly high number that shows just how much its customers value its services. And since this division represents about 67% of CVS Health's total revenue, I think it's safe to say that a major chunk of the company's revenue is well protected from potential e-commerce threats.

Image source: CVS Health.

2. MinuteClinic is a hit

A decade ago CVS Health recognized that customers greatly value convenient and affordable access to basic medical care, so they acquired MinuteClinic. This company pioneered the concept of quick and easy access to basic medical services, and CVS Health has seen huge success from bringing this innovative business under its wing. In 2015, MinuteClinic served more than 18 million patient visits and boasted a 95% customer satisfaction rating.

MinuteClinic provides a service that e-commerce players simply cannot match, which is a big reason why its revenue continues to grow at a healthy pace. Last-quarter revenue from this segment jumped by 17.7%, despite a slower-than-expected flu season.

CVS Health currently operates more than 1,100 MinuteClinic locations, but it has announced plans to bring that number up to 1,500 over the next few years. How high that number can go is anyone's guess, but with more than 9,600 retail-store locations in its empire right now, there is plenty of room for the company to continue rolling these out. That should only make the company's stores all the more appealing and keep them safe from online retailers.

3. Innovations in customer convenience

One of the major reasons that customers continue to spend more and more of their retail dollars at Amazon.com is the incredible convenience that the site offers. After all, it's far easier to buy something from the convenience of your own home than to have to drive down to a brick-and-mortar store. So for retailers to stay competitive, they need to amp up their own convenience.

CVS Health has been making these investments for quite some time, and it has seen a lot of success from its efforts. One recent innovation is ScriptSync, a program designed to make it easier for patients with multiple prescriptions to get refills at the same time. ScriptSync has only been available for a few months, but it already has more than 1 million customers signed up.

Beyond ScriptSync, the company is also experimenting with curbside pickup, and many of its stores already feature drive-through. Customers can even go online or use the company's custom app to make an appointment at a local MinuteClinic.

Finally, it's worth pointing out that last year's $1.9 billion acquisition of Target's pharmacy and clinic business should also increase customer convenience. This move not only expanded its retail footprint by more than 20%, but it also gives customers yet another easy way to interact with the company's pharmacists or pick up their prescriptions.

A wide moat

Taken together, CVS Health has built itself a wide and enduring moat that makes it as close to Amazon-proof as a retailer can get. I think CVS Health is a stock that even Warren Buffett could learn to love.