Capital gains tax is paid on the earnings you get when you sell stocks at a profit. It's income like any other income just taxed at a different rate. Without a capital gains tax, people from wealthy families would almost never pay taxes at all.
Here's what happens without a capital gains tax:
I buy stock for $1. I pass it to my kids. In 20 years, it's worth $50M. They sell it tax free and enjoy the rest of their lives laughing at all the schmucks who work for a living and actually pay taxes.