Like most of its department-store peers, Kohl's (KSS 0.55%) has experienced a sales slowdown in recent years, as the rise of e-commerce has undermined traffic at brick-and-mortar stores.

Sales fell again in the second quarter. However, the pace of decline slowed, showing that Kohl's sales-driving efforts are starting to gain traction. Profitability remained strong as well. This should provide long-term investors greater confidence that Kohl's can be a winner in the fast-changing retail industry.

Kohl's has an advantage

Sales growth has been sluggish -- or nonexistent -- at Kohl's since the Great Recession. Indeed, the company has posted comparable-store sales declines in three of the past four years, including a 2.4% drop last year.

The exterior of a Kohl's store

Kohl's has been affected by the broader retail sales slump. Image source: Kohl's.

That said, because of its unique real estate strategy, Kohl's may be better positioned for long-term success than rivals such as J.C. Penney (JCPN.Q). Whereas most department stores are based in malls, Kohl's focuses on standalone and strip-mall locations. For most consumers, it is less of a hassle to go to the local Kohl's store than it is to visit the nearest mall.

As a result, J.C. Penney was never able to recover from a failed strategy change former CEO Ron Johnson implemented in 2012. J.C. Penney is barely profitable today, and its sales remain more than 25% below 2011 levels. By contrast, while Kohl's isn't quite as profitable as it once was, it still makes plenty of money. Furthermore, its sales are within 5% of all-time highs.

A solid second quarter

In the first quarter, comparable-store sales declined by 2.7% at Kohl's. Earnings per share surged 26% year over year, relative to a very weak performance a year earlier. Even so, Kohl's executives were not satisfied.

Kohl's was more successful last quarter, though. Comp sales slipped just 0.4% year over year. The company's profit margin contracted slightly, but thanks to its ongoing share buyback program, Kohl's increased EPS to $1.24 from $1.22 a year earlier. This beat the average analyst estimate by $0.05. For comparison, J.C. Penney reported a 1.3% comp sales decline and lost money for the quarter.

Kohl's has a plan to get better

Kohl's CEO Kevin Mansell noted that customer traffic trends improved significantly in Q2 relative to the first quarter. In fact, transactions increased on a year-over-year basis at Kohl's in July.

Mansell is hopeful that Kohl's can build on this positive trend in the second half of 2017 and beyond. First, like many of its competitors, Kohl's is speeding up the process of designing, manufacturing, and shipping private-branded merchandise. This will allow it to react better to changing style trends.

Second, Kohl's is steadily increasing its use of personalization. It has begun to roll out personalized pricing, with promotions specific to each customer. In a similar vein, Kohl's will soon offer discounts for picking up online purchases in a Kohl's store. The company also plans to further "localize" the merchandise assortments in its stores based on regional tastes.

Third, Kohl's plans to take advantage of its large store footprint to gain market share in areas where rivals like J.C. Penney are closing stores. (J.C. Penney closed more than 100 stores last month.)

Mr. Market isn't giving Kohl's enough credit

Even though Kohl's posted solid results last quarter, investors clearly aren't convinced that the company will be able to maintain (let alone grow) its earnings power. Kohl's stock is down more than 50% from its early 2015 high and currently trades for just 10 times earnings.

KSS Chart

Kohl's Stock Performance, data by YCharts.

Kohl's stock seems even cheaper when you consider that free cash flow is likely to remain well above the company's book earnings for the foreseeable future. Kohl's is steadily reducing its inventory levels, which frees up working capital. Additionally, the company isn't opening very many new stores these days, so capital spending is routinely lower than the depreciation and amortization expense reported on Kohl's income statement.

Aside from its rock-bottom valuation, the 5.8% dividend yield is another great reason to own the stock. This payout appears to be quite safe, as it represents less than 50% of Kohl's free cash flow over the past 12 months.

Investors seem to be lumping Kohl's in with troubled competitors like Sears Holdings and J.C. Penney. However, Kohl's remains fundamentally healthy, and could even benefit from those rivals' difficulties. As a result, I will continue to reinvest all of my dividends -- and I may even purchase additional Kohl's shares in the open market.