The results are in, and it's clear that the home improvement industry was booming in the second quarter. Both Home Depot (HD -1.12%) and Lowe's (LOW -1.65%) announced more than 20% sales growth along with soaring profits as consumers redirected spending from categories like eating out and vacationing toward their homes.

Yet for the second quarter in a row, Lowe's bested its larger rival in some key categories, including revenue gains. Let's look at that metric and two others that suggest Home Depot has some work to do to close the performance gap between the two businesses.

A man and a woman paint a room together.

Image source: Getty Images.

1. Building on the growth wins

Since he took over the CEO spot in mid-2018, Marvin Ellison, who used to be an executive at Home Depot, has been telling investors that Lowe's can compete at the top of the home improvement industry.

Ellison finally has some solid sales metrics to support that claim. Comparable-store sales gains landed at 35% versus Home Depot's 25% increase. Lowe's also outpaced its peer in the first quarter, with comps hitting 12% compared to Home Depot's 8% boost. Rather than any single outlier, the retailer did a bit better in many categories, from DIY to professional niches, via both the in-store and online selling channels.

2. Gaining profitability

Home Depot still holds the industry record for profitability, but Lowe's margin trends are more impressive these days. Operating income surged in Q2 to push its profit margin up to 14.5% of sales. Home Depot's operating income held steady at 16% of sales.

LOW Gross Profit Margin Chart

LOW Gross Profit Margin data by YCharts.

Lowe's spent more cash on employee compensation, COVID-19-related health equipment, and capital investments. Yet the retailer still managed to increase adjusted earnings by 74%. "These results surpassed our expectations," CFO David Denton said in a conference call with Wall Street analysts.

3. Gushing cash flows

Lowe's operating cash flow has more than tripled over the past six months to $12 billion while Home Depot's is up a more modest 74%. That success leaves the retailer in a flexible financial position heading into what could be a volatile selling environment over the next few quarters. Lowe's counts over $11 billion in cash on the books today, with another $3 billion in unused credit available at any time.

That huge hoard wasn't enough to convince executives to resume the stock repurchasing program they paused earlier in the year. Like Home Depot, Lowe's is staying cautious given the negative shock that the economy is still going through.

But the chain continues to spend freely on proven growth and efficiency initiatives, including its pro contractor services and its online selling platform. Lowe's is also putting more resources toward building on its lead in outdoor power equipment while massively expanding its supply chain.

Home Depot is targeting many of the same areas and has a longer track record of wins in the arena of capital allocation. That streak suggests the industry leader will beat back any competitive challenges to its position. But Lowe's is still in a better position to chip away at Home Depot's advantage than shareholders have seen in several years.