A stock is a type of investment. When you purchase stock in a company, that means you are buying a small portion of that company. In other words, you own shares of the company. And as a result, you are considered a shareholder of this company.
Companies will sell shares to raise money to operate their business. This money can be used for a variety of reasons, including funding growth and expansion or paying off debt.