The Capital Gains tax doesn’t just get applied to stock sales and purchases; it involves basically all forms of regulated investment. It goes all the way from small business LLCs all the way up. If you give your buddy $100 to start a brewery and he gives you back $2000 after he sells the brewery to AB Bev, as long as you have all the paperwork you can use the capital gains tax.
People are focusing on a very, very small part of the stock market: the day-to-day fluctuations and stuff. This is actually the least important part in a lot of ways.
When a company needs money, it can get it in several ways. It can borrow the money from someone, but then they have to pay it back, with interest. They can keep profit from sales and re-invest it in the company - but this presumes that they have enough profit to do this. Or, the company can sell partial ownership of the company for money. This way, it doesn’t have to pay the money back.
To sell part of itself for capital, the company can either do this via investment firms, which may buy a certain percentage of ownership of the company for a specific amount of money, or they can issue stocks. The first time is called an IPO, then subsequent offerings can be made at any time. This is when the company gets it’s investment.
The stock represents a partial ownership of the company, the dividends are the share of the profit that the stock owner gets, and the value of the stock is based on the ownership of the ongoing business or the value of the assets of the company.
Each share had an initial investment into the company. The raise in price over the IPO price or the strike price is the appreciation of the investment.
So why is buying an old stock still investment, when the company doesn’t see any of the money?
Because why would anyone buy a stock if they could never sell it?
You’re not investing in the company directly - but what you are doing is you’re buying the benefits of an investment someone else made a while back. The company doesn’t have to pay back the investment because instead of going back at the company for the money, you stepped up and said “I want to own that investment instead. I’ll give you $5 for it.” and they said “Great!”
The company can still get more investment by selling more stock. It can also do stock buybacks and either destroy the stock or keep it and sell it later for more money. Having the stock be a liquid asset that can be bought and sold encourages investment into the company because it makes the process easier to go through.
(I mean, consider if you had a 1% share of IBM that your grandpa bought in the 20’s and you needed to cash out to pay for medical bills and you had to run an add in the back of a newspaper to try to find someone who wanted to buy it. Or what would happen if you owned half the company and you wanted your money so you forced the company to liquidate to give it to you?)
The cool thing about the way the tax is structures (pay a percentage on the gains) is that (if the stock is always sold for more than it was purchased for) the government gets the same amount of taxes from the stock no matter how many times it is sold.
While you don’t get taxed on losses, if the stock looses money and you sell it and it eventually sells for more, the government gets more tax on it. (Imagine you buy a stock for $100, and sell it for $80, then someone sells it for $120. The government taxed the person you bought it for to $100, then gets to charge the person who bought it from you taxes on the profit from $80 to $120.