system
Given the following post, respond as if you're commenting on Reddit:
human
Buying Stocks: Where Does Money Go?

I had a question about how the stock market works.  So, if you buy a company's stock and invest in that company: does the company actually receive your money, or does it go to an individual who sold you the stock?

If my understanding is correct, the company only gets your money directly either when they initially go public, or if they issue more stock - is that accurate?  As a follow-up: if they do not receive your money: then why do companies focus so much on returning money to shareholders?  If shareholders continually supplied the company with the cash they needed to invest in the business, it would make sense to me, but otherwise it feels like it would be a one-way relationship in which investors collect the profits, but don't provide anything in return.
gpt
1) You are correct, the company only receives the money when the original stock issuance occurs. Any subsequent buying and selling of the stock is on a secondary market and does not provide any funding to the company. 

2) The stockholders are the owners of the company. They would have no reason to invest in the first place and provide capital to the company if they were not compensated for it. When a company returns money to shareholders, it is primarily done through dividend payments or by repurchasing shares, which reduces the amount of stock in circulation and increases the value of the ones that remain. This way the stock remains valuable, which is important for a few reasons. Top of mind is that if the company wants to raise capital in the future, they can issue more shares at a higher price and receive more funding from investors. 

A helpful way to think about this relationship may be the fact that most business/economics classes have historically taught that the main job of a company is to “maximize shareholder value” since they are the owners of the company. This view is changing some, but it is still helpful to keep in mind when understanding how a company views its shareholders.