you defer the gains from the sale using a 1031 exchange. Other tax implications - a cash out refi is a tax free
distribution of cash.
Depreciation helps reduce (or completely eliminates) your taxable income.
When you die, your heirs get a stepped up basis in the assets.