When Target (TGT -0.34%) sold its 1,647 pharmacies to CVS Health (CVS -0.74%) in 2015, many wondered why two companies that seemed like competitors would create a partnership. The two CEOs didn't share those concerns. Target's Brian Cornell, in the job only a year, said the deal would let his company commit to traditional items like home goods and apparel, as well as food. For his part, Larry Merlo, the CVS chief at the time, said the companies had complementary brands, and the deal would be good for customers of both.

In the past few years, it's also been good for shareholders. The stocks of both companies sit at the highest level of the past few years. For Target, it's also an all-time high.

CVS Chart

CVS data by YCharts.

Both Target and CVS recently backed up a great 2020 with impressive first-quarter results and guidance. That's likely why the recent swings in the market haven't affected either stock. In fact, the tailwinds for both companies might keep them immune from market volatility.

A woman with a mask on shopping in a grocery store.

Image source: Getty Images.

Target

The company's record sales and profits last year came on the back of smaller businesses that were forced to close due to the pandemic. Its $93 billion in revenue was not only a record, it was also $15 billion more than in 2019. That growth was more than the previous 15 years combined. The first quarter of 2021 proved the tailwind is still blowing strong.

Its store-as-a-hub model has been a perfect fit in a world where consumers rapidly adopted digital sales. Although people weren't stocking up like they were last year, same-day services such as in-store pickup, drive-up, and delivery climbed 123%. It highlights how the retail landscape might have changed over the past year. Many of the customers who have become accustomed to placing digital orders will not go back to wandering through the store filling a basket.

Management expects the growth to cool off, from 23% in the first quarter to the mid to high single digits in the second quarter. It is projecting the final two quarters of the year to have growth in the single digits. That isn't specific, but it's enough to guarantee another record year. It's also enough for Wall Street to push shares to the highest price-to-sales ratio since the booming mid-2000s.

TGT PS Ratio Chart

TGT PS Ratio data by YCharts.

Back then, Target was growing sales by a consistent 13% each year. That won't be the case now; the company's market cap is 2.5 times what it was then. Despite the valuation, if it keeps putting up numbers like it just reported, general market sell-offs aren't likely to hurt shares of Target.

CVS Health

The story of CVS over the past year has its roots in that 2015 deal to bring Target's pharmacies under its umbrella. The expanded footprint gave it more access to foot traffic and allowed year-over-year sales to grow 4.6% in 2020. The company continues to play a leading role in testing and vaccination for COVID-19. That proved to be a crucial channel for sales in the most recent quarter.

Becoming that convenient healthcare hub, and delivering tests and vaccines, helped CVS offset a significant drop in year-over-year activity. Front-of-the-store sales fell 11.4% compared to the first quarter last year, when consumers were stocking up on household items. Combined with the pharmacy -- which saw stocking-up of its own last year as people pre-filled prescriptions -- sales climbed only 0.4% over the same period in 2020. Despite those lackluster numbers, overall revenue was up 3.5% in the quarter.

As long as COVID-19 persists, testing and vaccinations should bolster results. Among those who get tested for the virus, about 9% end up filling a prescription at the store. That's giving new CEO Karen Lynch confidence to raise full-year EPS guidance by 2% to between $7.56 and $7.68. That would put the P/E ratio at the lower end of its historical range by the end of the year.

CVS PE Ratio Chart

CVS P/E ratio data by YCharts.

CVS is continuing its journey to redefine itself as a healthcare company. Its role in the pandemic validates the new identity. So does its conversion of roughly 800 stores into health hubs that offer services like testing for sleep apnea and mental health appointments. Furthermore, it announced it will rejoin public health exchanges in 2022 with a first-ever CVS-Aetna branded insurance offering.

So far, Wall Street likes the strategy and has spared it from the selling affecting other sectors. If the company can keep integrating services to become the health hub it envisions, shareholders are likely to be spared any further volatility affecting the overall market.