When you buy stocks in a company, you are buying part ownership in that business. Even if you only own a small fraction of the business, this ownership gives you certain rights. For example, as a shareholder you vote to determine who is on the board of directors. You also have the right to receive a dividend if the company issues one.
For most people investing in a stock is a matter of buying the stock and then selling it in the future when the value others are willing to pay for the company is greater. The value of a company doesn't always go up. If you buy the stock of a company that the goes out of business, you will lose your money. The value of stocks isn't guaranteed like some investments. In return for a higher potential rate of return the investor takes on a higher risk of loss.
In the past the way to buy stocks was through a stock broker. Now there are many places where you can buy stock through an online website and the transaction is handled via computers. Most of the time buying stocks involves some type of brokerage fee. Usually these fees range from $5 to $50.
When you purchase a stock your loss is limited. You cannot lose more money than you put into the stock. In some other types of transactions your loss is unlimited and you can potentially lose more money than what you invested.
The US law allows stockholders to have limited liability. In other words, you cannot be sued for the actions of companies in which you hold stock. The company can be sued and this may reduce the value of your stock, but lawsuits can't attack your personal assets based on the actions of a company in which you are merely a stock holder.
Originally stocks were sold in shipping expeditions. The shipping expedition would sell stock in order to buy a ship and pay a crew to travel far away carrying cargo to trade with other lands. When the ship returned it would sell the goods and pay all the investors based on how many shares of stock they had purchased. If the ship was lost at sea, the stock holders may have lost all their money.
One of the big advantages of a stock is the tax treatment. You don't pay any tax until you sell the stock. So if the stock goes up, you pay no tax until you actually realize the profit. With careful planning this can be used to minimize tax liability. This attribute of stocks is particularly useful if you want to donate a stock to a charity. You can donate the stock and take a deduction for the full value of the stock at the time of the transfer without being required to pay tax on the gain. This means you can take the deduction without paying the tax on the income.