Basis from the relinquished (sold) property to the replacement (new) property must be carefully tracked and calculated by your tax professional to ensure a successful 1031 exchange.
In 1031 exchange your gain is deferred until a sale occurs or there is a step up in basis.
A very simple basis can look something like this: the price you paid for the property, less depreciation claimed over the years of ownership, plus any improvements to the property, plus any additional adjustments.
One way to garner additional depreciable basis, and subsequently shelter to cash flow, is to acquire debt with leveraged DSTs. This debt brings risk that would not occur in an all cash property but the benefit is the potential shelter of income.
When the new replacement property is sold in the future (assuming no further 1031 exchange), the original deferred gain, plus any additional gain realized since the purchase of the replacement property, is subject to tax.