On Wednesday evening, Staples (NASDAQ:SPLS) announced that it had agreed to sell itself to private equity firm Sycamore Partners for $6.9 billion, or $10.25 a share. This confirmed months of rumors that Staples planned to go private. Assuming that shareholders approve the deal, Staples expects the sale to close by year-end.

This buyout is definitely a consolation prize compared to Staples' previous plan to buy its main rival, Office Depot (NASDAQ:ODP). But with federal regulators having quashed that deal last year, going private was probably the best remaining option for Staples.

A disappointing outcome

A decade ago, Staples shares traded for about $25. Even as recently as early 2015 -- shortly after Staples reached a deal to buy Office Depot -- the stock was worth $15-$20.

SPLS Chart

Staples 10-year stock performance. Data by YCharts.

However, prior to this week's buyout announcement, Staples stock had been mired in single-digit territory for more than a year, ever since the Office Depot deal fell through. Staples' ongoing sales struggles meant that the stock wasn't likely to bounce back anytime soon.

Indeed, comparable-store sales for Staples' North American retail operations declined 5% last year and fell 6% in the first quarter of fiscal 2017. Furthermore, while growth in its North American delivery segment (which produces the majority of its revenue and profit) had been insulating Staples from weak in-store sales, comp sales turned negative in the delivery business last quarter.

Analysts expect Staples to post adjusted earnings per share of $0.88 this year and $0.87 in fiscal 2018, down from $0.90 last year. Of course, it's possible that Staples would have surpassed Wall Street's expectations. But with key aspects of its business in secular decline -- such as selling ink, paper, and computers -- it's equally possible that Staples would have missed those earnings estimates. It's unlikely that Staples investors would do better under the status quo.

Did Sycamore overpay?

Not surprisingly, some Staples shareholders think that Sycamore Partners isn't paying enough for the office supply giant. However, given the secular headwinds facing Staples, other observers contend that Sycamore Partners is making a mistake by buying Staples at all. After all, the company lost money last year, based on generally accepted accounting principles.

The interior of a Staples store

Staples faces secular declines in some of its key product categories. Image source: Staples.

However, that loss was driven by costs related to terminating the Office Depot acquisition (including a $250 million breakup fee), as well as big one-time charges from Staples' moves to restructure its North American business and sell off most of its international operations. Excluding those charges, Staples' net income totaled $586 million last year.

In addition, for a buyout fund, cash flow is far more important than accounting measures like net income. Staples posted free cash flow of $679 million last year, despite a $210 million headwind from merger termination costs. For 2017, Staples expects to generate at least $500 million of free cash flow. Given that it produced $221 million of free cash flow in the first quarter, this forecast seems conservative.

Thus, Staples produces ample free cash flow to cover the high interest costs that will come from going private. If it can sustain its strong cash flow during the next five to seven years, Staples should also be able to pay down debt steadily and generate good returns for Sycamore.

Cash is king

Looking ahead, if Sycamore Partners is able to complete its buyout of Staples, maximizing cash flow should be its No. 1 priority.

It will still be important for Staples to invest money to maintain its stores and improve its e-commerce capabilities. However, it should continue to downsize its retail footprint in the next few years, which will reduce capex needs. Staples has already cut its store count in North America by 20% since the beginning of 2012, and the leases for about half of its remaining fleet will expire within the next three years, giving it ample opportunity to close more stores.

Staples also ought to avoid instigating any price wars with Office Depot in the next few years in its commercial supply business. While chasing market share can pay off in certain cases, it can undermine margins as well, making it too risky for a private company with a heavy debt load.

The Staples buyout could be a lucrative deal for Sycamore Partners -- but there's also a very real risk that it will lose a lot of money. This suggests that the $6.9 billion purchase price may be appropriate, after all.

Adam Levine-Weinberg has no position in any stocks mentioned. The Motley Fool has no position in any of the stocks mentioned. The Motley Fool has a disclosure policy.