The tax code is written so that the accumulated capital gains taxes are eventually supposed to be paid. But when an individual owns the real estate, the properties can be held until death. At that point, all of the embedded capital gains are wiped out, so no capital gains tax is owed. The family inherits the properties at whatever value they were appraised at on the date of death.

Along the way, though, the owner could have refinanced the building and taken the cash out. It’s known in real estate parlance as “the harvest,” and as long as the building’s cash flow is enough to cover the debt payments, the money is tax-free, said Kevin D. Gray, a lecturer in real estate at the Yale School of Management and the Yale School of Architecture.

Death and taxes are unavoidable, but real estate investors can circumvent the second part by using estate planning to significantly lower, if not eliminate, taxes on hundreds of millions of dollars of property at death.

The estate tax exemption for a married couple is $22.8 million, so generous that only a sliver of the wealthiest of the wealthy will need to worry about it. But commercial real estate is generally owned through a partnership or limited liability company, in which there is no tax at the corporate level and all the gains and losses flow through to the individual. They have a built-in advantage allowing owners to transfer exponentially more to heirs free of taxes.

Consider a building worth $30 million. If the owner puts it into a trust for his heirs, he can discount the value by a third or more because a fractional stake in the partnership that owns the building is worth less because it lacks control and marketability, according to the Internal Revenue Code. The buyer is likely to be just another family member.

That 30 percent discount, or $10 million, on the real estate is a benefit that someone with $30 million of Google stock does not get, but there’s more, said Justin Miller, national wealth strategist at BNY Mellon. At a conservative 7 percent growth rate, the building could be worth $120 million, when other deductions are considered, in 20 years’ time, he said.

The owner could then swap the building for $120 million of stock, making it easier for his heirs to divide. The building would be valued at its original price for capital gains taxes, but when the owner died, all of those taxable gains would die with him. Or, Mr. Miller said, the owner could take a $120 million loan, and the loan and the building would cancel each out at death, resulting in no estate tax.