Capital gains tax is a double tax
Capital gains tax is a tax you pay for investing successfully. If you bought some shares, for instance, for $1 a share in 2010, and sold them in 2020 for $2 a share, that's a $1 capital gain, and depending on a number of variables, you owe the government tax on that. If you're in the middle class income tax bracket, in the US that's a 15% tax rate, or $0.15 cents a share.
This tax is ridiculous and should never exist, but that's true of all taxes, so let's skip to the part where this tax is actually a double tax.
Is your investment really going up in value?
You see, appreciation in value for most investments is actually nominal, and occurs due to inflation. Nominal means that the value of the item appears to have gone up, but hasn't really. For instance, if you invest $10 in stocks in 2010, and in 2020 they're worth $20, you could say you doubled your investment. But dollars are only worth what you can buy with them, and that's true of any currency. So in 2010, back when the price of a soup can was $1 each, your $10 was worth 10 soup cans. If in 2020 the price of soup cans has gone up to $2 each, your $20 are still only worth 10 soup cans.
If however the price of soup cans didn't go up, or didn't go up as much as your stock value, then you can say that you had a real gain on your investment.
Since most investments attract gains of less than 10% per year, and since in the U.S. the annual rate of inflation is about 10%, most investments are depreciating in real terms, even if they look like they're growing.
But the government doesn't care about what your dollars are worth in real terms, after all, they're the ones devaluing them by printing more of them every day. So when they tax you for capital gains, they tax you for what it looks like you gained, in other words, the nominal value of your investment.
The double tax
If your investment went up by exactly 0 in real terms, but doubled in nominal terms, and you liquidate it today, you owe capital gains tax on value you never really gained. Even if the government allowed you to account for inflation when calculating your capital gains tax, it still wouldn't matter, because officially inflation rates are at around 2%. Since the government routinely lies about the real rate of inflation, and you'd have to use the official estimate, you'd still be screwed.
This is why capital gains tax is a double tax. First, the real value of your investment is taxed through inflation. Then, the "inflation" (excuse the pun) of your investments' value is taxed a second time with capital gains tax. You're paying a tax on a tax.
But hey, I'm sure the IRS has a suggestion box where they value taxpayer feedback and adjust their tax rates based on fairness. Ha!