The short answer is stocks allow investors to own a portion of the company while bonds are loans to the company.
The long answer is in order for a company to be properly funded it must maintain a balance between stock and bonds. Stock allow people or entities to actual own a portion of the business. The more stock shares that out there the smaller the percentage of the company that a person own. Bonds are basically debt that the company agrees to pay back at a later date to the investor of the bond typically with some extra money added called interest.
Owners of certain types of stocks are able to receive dividend payments and stock holders have voting rights, while bond holders receive agree upon interest payments and retain no voting rights. Another difference between the two is when companies run out of money they need to sell off the company. You would think that since you bought stock in the company you would actually get a piece of the value from the sale, but in the event of liquidation stock holders are considered low priority. On the flip side, bond holders have a higher priority of receiving some type of payout during liquidation.
Just remember what best describes the difference between stocks and bonds is the reason why some investor prefer on to the other. Bonds are less risky, lack long term returns but generate income for the investor while stocks have the ability to generate larger returns but is not guaranteed.