The sale and leaseback of a company's owned real estate works pretty much the same way. When a company is in great financial shape, it can command the best terms, including the right combinations of highest sale price and lowest cost and/or flexible leaseback terms. When a company experiences tough times, those buyers who invest in sale / leasebacks recognize that a greater risk exists of the company failing. Since the value of sale / leaseback transactions is most often based more in the on-going cash flow to be generated by the seller / tenant than the real estate itself, the seller / tenant's credit risk becomes a key factor is determining the level of interest by buyers, as well as their purchase price and the terms of the leaseback.
Of course, external factors come into play, too, such as interest rates; availability of capital and liquidity; lender appetites; attractiveness and availability of alternative investments; competitive supply and demand; global and regional economics; and more. But, isn't that also true of bank lending and other investments?
Owned real estate, like most other corporate asets, does not bring a company the greatest return by holding onto it as long as possible or until other assets have been exhausted. Real estate is a resource with value that must be properly understood in order for it to be effectively employed to a company's financial and oprational betterment. Like a great stock or other investments, owned real estate will derive the greatest value for a company when it is deployed or redeployed strategically, not as a means of last resort.