Capital gains are not inflation-indexed at all.
Buy an asset for $10,000 in 2015. Sell for $20,000 in 2025 — you nominally doubled your money. If the dollar lost 40% of its purchasing power in that period, your real gain is much smaller. You still owe tax on the full $10,000 nominal gain.
The government shares in nominal gains. The investor bears the purchasing power loss. The inflation-generated portion gets taxed as if it were real income.

