Companies initially raise money by selling their stock. A share of stock represents fractional ownership of a business. When you buy shares of stock in a company, you are buying a small fraction of the business and all the profits that go along with it. For example, if ABC Company needed to raise $1,000,000 they could sell 100,000 shares at $10. Each share that you owned would represent 1/100,000th ownership of the company.
Keep in mind that some companies are “public” and some companies are “private”. Private companies are smaller companies that have raised money through a small number of investors and their stock does not have an active market where it can be bought and sold. Public companies have sold their stock to many investors (shareholders) and have registered their shares with the Securities and Exchange Commission and with an exchange (NYSE, AMEX, or NASDAQ) and hence their shares can be bought and sold with ease on an exchange.
The two main types of shares are common and preferred stocks. Common stock gives the owner the right to vote at shareholder meetings and receive dividends if any are declared. While preferred shares typically don't confer voting rights, they have priority over common shares for earnings and assets. This means when a company declares dividends, preferred shareholders are paid before common ones and have a higher claim to assets if the company goes bankrupt and is liquidated.