When an authorized-participant redeems, the fund delivers a basket of its holdings. The fund chooses which tax lots to hand over and naturally selects the ones with the largest unrealised gains, removing them from the portfolio without a sale. No sale means no realised gain to distribute.
This is the structural tax advantage of an etf over a mutual-fund, and it is why broad equity ETFs commonly distribute no capital gains for years at a time while comparable mutual funds distribute regularly.
Example: a fund holds 100,000 shares bought at $30, now $95. Redeeming in kind moves them out with a $6.5M embedded gain untaxed. A mutual fund selling the same block distributes that $6.5M to its remaining holders.
Related: creation-redemption, etf, mutual-fund, cost-basis, authorized-participant