It's easy to overlook the importance of a diversified portfolio, but holding a minimum of 25 high-quality stocks can help shield your total returns from volatility. However, diversity isn't just about the number of stocks you own; it's also helpful to spread your investment dollars across a range of different industries. In doing so, you decouple the performance of your portfolio from any specific sector.

With that in mind, these companies operate in very different industries, but both have built durable moats around their businesses. Here's why Lowe's (LOW -1.40%) and Salesforce.com (CRM -0.18%) look like smart long-term investments.

Investor drawing charts on a blackboard.

Image source: Getty Images.

Lowe's

Lowe's is the second-largest home improvement retailer in the world, and it operates or services over 2,200 stores across the United States and Canada. Its business addresses both retail and professional customers, offering a broad range of products for construction, maintenance, repair, remodeling, and decorating.

Collectively, these categories comprise a highly fragmented $900 billion opportunity in the U.S. alone. And despite being the second-largest retailer in the industry, Lowe's holds just 10% market share, leaving plenty of room for future growth.

To that end, management announced the Total Home strategy last December, a growth initiative aimed at making Lowe's a one-stop shop for every product and service a homeowner might need, from supplies for repairs and improvements to rental tools and installation services. The company is also taking steps to expand its supply chain capacity, adding new cross-dock delivery terminals, distribution centers, and e-commerce fulfillment centers.

Man stacking lumber at store

Image Source: Getty Images

So far, management's efforts are paying off. During the second quarter of 2021, Lowe's U.S. comparable sales climbed 32% over the same period in 2019. And online sales rose 7% over the prior year, which is quite impressive considering its e-commerce revenue surged 135% in the second quarter of 2020.

Zooming out, Lowe's has also delivered solid financial results over the long term. The company's bottom-line performance is particularly noteworthy, showing its improving operating efficiency.

Metric

Q2 2016 (TTM)

Q2 2021 (TTM)

CAGR

Revenue

$61.1 billion

$94.6 billion

9%

Earnings per share

$3.10

$9.69

26%

Source: YCharts. TTM = trailing-12-months. CAGR = compound annual growth rate. Note: Earnings per share is based on diluted share count.

Over the period shown above, Lowe's return on invested capital (ROIC) -- the ratio of after tax operating income divided by the total capital invested in a business (i.e. shareholder equity and debt) -- has climbed from 13.1% to 28.5%. Put another way, management is deploying capital very efficiently, and Lowe's now generates twice as much cash per invested dollar as it did five years ago.

Of course, Home Depot's ROIC currently sits at 40.6%, but Lowe's is moving in the right direction. And given its solid competitive position, strong growth strategy, and massive opportunity, I think the company is well positioned to gain market share in the years ahead. That should translate into steady returns for patient shareholders.

Salesforce

Salesforce specializes in customer relationship management (CRM). Its platform comprises a suite of applications aimed at improving sales, customer service, marketing, and commerce. It supplements these solutions with tools for data integration, analytics, and artificial intelligence, helping clients build a rapport with customers, maintain loyalty, and grow their businesses.

Notably, Salesforce is the leader in the CRM industry, holding 19.5% market share -- more than the next four competitors combined. Moreover, research company Gartner recently recognized Salesforce as the best-in-class solution for multichannel marketing, customer engagement, and sales force automation. Collectively, those selling points have helped the company win over 150,000 clients.

Over the last five years, Salesforce has delivered strong financial results like clockwork.

Metric

Q2 2017 (TTM)

Q2 2022 (TTM)

CAGR

Revenue

$7.5 billion

$23.5 billion

26%

Free cash flow

$1.6 billion

$5.5 billion

28%

Source: YCharts. TTM = trailing-12-months. CAGR = compound annual growth rate. Note: Q2 2022 ended July 31, 2021.

Also noteworthy, through the first half of the year, Salesforce's attrition rate hit 8%, down from 9% last year. This metric ignores clients that spend more, and instead measures the portion of annualized revenue lost to churn. In short, the company's declining attrition rate means it's keeping more dollars on its platform, demonstrating the value it creates for customers.

Salesforce recently completed its acquisition of Slack, a tool that facilitates enterprise communications. As part of Salesforce, Slack will make collaboration even easier, connecting each client's employees, customers, and partners to create a sort of digital headquarters. This makes Salesforce an even more compelling option as more organizations navigate the complexities of hybrid work models.

Going forward, management puts its market opportunity at $248 billion by 2025, leaving Salesforce with plenty of room to grow its business. And given its strong competitive position, shareholders should expect market-beating returns in the years ahead. That's why this growth stock looks like a smart long-term investment.