Kohl's (KSS 2.41%) and J.C. Penney (JCPN.Q) are two of the largest department store chains catering specifically to the middle class.

Sales growth has stagnated at Kohl's in recent years.

A few years ago, J.C. Penney looked like it was heading for bankruptcy after it implemented a disastrous new strategy. However, since 2013, it has executed a remarkable turnaround, returning to consistent sales growth. Meanwhile, Kohl's has faced its own struggles, with sales having stagnated in the last few years.

For two years, J.C. Penney has been posting better comparable-store sales growth than Kohl's. However, on most key investing metrics, J.C. Penney still lags Kohl's by a wide margin. This makes it a much riskier stock than Kohl's.

Winning the comp sales game
Comparable-store sales is a metric frequently used to assess department store operators' health. It reflects year-over-year changes in sales after stripping out the impact of opening or closing stores.

In 2012, J.C. Penney's comp sales plummeted 25.1% as the company's new strategy failed to resonate with customers. Comp sales fell another 7.4% in 2013. But by 2014, J.C. Penney had returned to growth, with comp sales up 4.4% for the full year. The company is on pace for similar or better results in 2015, with comp sales up 4.6% through the first three quarters of the year.

Kohl's hasn't experienced such dramatic swings in its sales performance. Comparable-store sales rose a meager 0.3% in 2012 and then dipped 1.2% in 2013 and another 0.3% in 2014. Through the first three quarters of 2015, comp sales are up 0.8% year over year at Kohl's.

Thus, J.C. Penney is on pace to gain market share from Kohl's for a second straight year, posting significantly higher comp-store sales growth. However, this is just one piece of the story for investors.

The pain of 2012 and 2013 remains
Another critical performance metric for retailers is sales per square foot. This measures how efficient a retailer is at generating revenue in its stores.

On this metric, Kohl's is (still) far better than J.C. Penney. Last year, it produced $226 in sales per selling square foot, down slightly from a peak of $232/square foot in 2011. Meanwhile, J.C. Penney generated only $155 in sales per selling square foot last year. Even in 2011 -- before the massive sales declines of 2012 and 2013 -- J.C. Penney peaked at $212 in sales per selling square foot, nearly 10% worse than Kohl's.

J.C. Penney generates significantly lower sales per square foot than Kohl's.

J.C. Penney's poor performance in 2012 and 2013 had an even bigger impact on its profitability. Between 2012 and 2014, the company lost an average of more than $1 billion per year. Even with comp sales growing at a fairly impressive 5% rate, most analysts expect J.C. Penney to remain unprofitable until at least 2017.

By contrast, while Kohl's operating margin has retreated from double-digit territory in the past few years, it still earned a very solid 8.9% operating margin last year.

From a balance sheet perspective, Kohl's is also in much better shape than J.C. Penney. It has an investment grade credit rating, whereas J.C. Penney's credit rating is deep within "junk" territory. J.C. Penney actually has only slightly more debt than Kohl's, but it generates less revenue and dramatically less cash flow to support that debt load.

J.C. Penney needs to maintain its upward sales trajectory
For every year that J.C. Penney can sustain its high comparable-store sales growth, its other operating metrics should improve, too. Sales per square foot will rise. This higher sales productivity should lead to stronger profit margins and higher free cash flow, allowing J.C. Penney to reduce its debt load.

For now, Kohl's remains the stronger company on nearly every key metric. However, Kohl's currently has a market cap four times higher than J.C. Penney while only producing roughly 50% more revenue, indicating that there's a big opportunity for J.C. Penney stock to rise if it can get its operating metrics closer to those of Kohl's.

However, investors should recognize that this requires sustaining mid-single-digit sales growth for many years. In a highly competitive retail environment where mall traffic is declining, there is a very real risk that J.C. Penney's turnaround will falter within the next few years, limiting the stock's upside.