With this quarter's retail earnings season finally coming to a close, it's clear who the winners and losers are. Department stores, apparel, and electronics are suffering, while home improvement is shining.

There's no better example of this growing bifurcation than Home Depot (HD 1.98%) -- the retailer has thrived in the last five years as the housing market has bounced back. But macroeconomics aren't the only thing fueling its success. Savvy management and smart strategic decisions have helped the chain consistently outperform rival Lowe's (LOW 1.19%) over the past five years.

HD Chart

Data by YCharts

As the chart above shows, while Lowe's stock gains have nearly kept pace with Home Depot's, Home Depot's profit growth has more than doubled that of its smaller rival. Home Depot's success comes from one key decision in recent years.  

No new stores

The company finished 2015 with the same store count it had in 2008 -- 2,274. Sales haven't slowed in that time, however, growing more than 30% since their bottom following the recession, driving explosive profits as the company resisted the heavy costs of opening new stores.

Management recognized early on that e-commerce made aggressive store expansion unwise and chose to invest profits elsewhere. Rival Lowe's, meanwhile, opened 191 new stores between 2008 and 2014, and its profit growth seems to have suffered as a result.

Instead of spending on new stores, the company invested those resources into other opportunities like targeting professional contractors -- the source of 40% of its sales -- integrating e-commerce with store operations, and improving its supply chain.

Home Depot aims to grow sales from $88 billion last year to $101 billion in 2018, a compound annual growth rate of just 4.7%, but the lack of new stores means it can boost its operating margin from 13% to 14.5% and increase return on invested capital from 27% to 35%. Such an increase in operating margin and sales would lift operating profits by a compound annual rate of about 9%. Factor in a solid share buyback program, and you have a recipe for healthy earnings per share growth. 

Better stores > more stores

There's no question that buying online is only going to get more convenient over the coming years. Amazon.com is hellbent on that mission, rolling out its Prime Now one-hour delivery service and Prime Fresh food delivery to an ever-increasing number of cities, and improving technology will ensure that start-ups like Uber, Instacart, and Blue Apron keep popping up to help consumers avoid the tedium and hassle of shopping.

In this kind of environment, adding new stores will only help retailers compete against other brick-and-mortar chains, not against the rising e-commerce threat.  Though e-commerce makes up less than 8% of total retail sales, in the first quarter of this year it accounted for almost a third of total retail growth, and that was during an unusually strong quarter for retail. 

More stores won't mitigate this threat, but better ones will. As e-commerce continues to grow, integrating the online sales platform with the physical store will be imperative. One retailer that seems to be adapting to this transition is Wal-Mart (WMT 0.98%). After years of rampant expansion, the big box giant is scaling back on new store openings and investing instead in e-commerce, higher wages, and sprucing up current store locations. The world's largest retailer already has a store within five miles of 70% of the U.S. population. Access is clearly not the issue -- it's the basic stuff retail competition is made of: quality, service, and convenience.

Wal-Mart seems to have tapped into a new revenue stream with its rapidly growing grocery pick-up service. The new program takes advantage of the company's brick-and-mortar footprint and e-commerce capabilities by allowing users to order groceries on Wal-Mart's website or app and then pick them up from a kiosk in a store parking lot. Its continued expansion shows that the new service is popular and delivering results for Wal-Mart.

Other retailers should take note. Such a platform could serve as a model as retailers look to leverage their real-world space over Amazon and as the bar for convenience keeps getting raised.

It's clear that store improvements and integration are a must for brick-and-mortar retailers to thrive. Home Depot has led the way. It's time for the rest of retail to follow.