It's been hard to go wrong investing in home improvement over the past decade. The two most dominant U.S. retailers in the space, The Home Depot (HD -1.77%) and Lowe's Companies, have trounced the broader market over the past 10 years.

Sure, you could own both, but have you ever wondered what might give one the edge over the other? Here is a financial metric that can tell a lot about a company -- and potentially be the tie-breaker between these two very similar stocks.

What is "CROCI" and why does it matter?

The cash return on capital invested (CROCI) is a fascinating metric you probably haven't heard much about (if at all).

The metric tells you how much cash profits a business generates from the capital it puts to work. Factors like accounting rules, noncash items, etc. can skew many common ratios and metrics. This metric aims to determine that if a business spends $1, it will generate X in cash profits in return.

It's expressed as a percentage and calculated by dividing a company's EBITDA (earnings before interest, taxes, depreciation, and amortization) by its total equity value. A higher number is better, but 10% is a rough rule of thumb to figure out a good score. This metric works best on profitable companies with long operating histories to show you a long-term trend.

Businesses with high CROCI tend to be well-managed, have strong business models, or both. A company that generates lots of cash with every dollar it spends will probably be putting money in your pockets through share repurchases, dividends, or might invest back into the business since its returns on capital are so high.

Home Depot and Lowe's head-to-head

You can see the CROCI for both Home Depot and Lowe's below, and you'll notice how both companies pass that 10% benchmark with flying colors.

Home Depot and Lowe's are very similar companies, which makes the former's superior CROCI percentage over most of the decade noteworthy. It shows that Home Depot has gotten more cash profits from its capital than Lowe's. The gap has closed since COVID-19, and it'll be interesting to see what the trend does in the years ahead.

HD Cash Return on Capital Invested (CROCI) (TTM) Chart

HD Cash Return on Capital Invested (CROCI) (TTM) data by YCharts.

Using CROCI alone isn't enough to make an investment decision. In fact, Lowe's stock has outperformed Home Depot over the past decade -- up 616% vs. 467% for its rival's shares -- though they were pretty tight until the past two years.

But CROCI can act as a compass, showing you the general direction a company is heading in. It's a great litmus test that can help you know a broad taste of a company's quality.

Which would I buy?

As a long-term investor, I am looking for businesses that will generate the most output for shareholders with the least input.

Home Depot's track record of a superior CROCI could mean that it runs its ship ever so slightly better than its rival and is thus my personal preference, though both have proven to be winners.

Of course, Lowe's could surpass Home Depot moving forward, but Home Depot gets some benefit of the doubt because the past two years have been pretty chaotic between COVID-19 and soaring inflation.

You'll set yourself up for long-term investing success if you can build a diversified portfolio of companies that can efficiently generate cash profits like Home Depot and Lowe's do.