There are two ways a business can fund its operations (and thus, two ways someone can invest in the operations of a business). The first is debt, and the second is equity.
What is debt?
Debt is an obligation owed by one entity to another. When a business issues debt, it is borrowing assets from the lender now, and entering an agreement to repay the original assets at a future time, plus interest.
Thus, when we lend capital to a business, we are giving the business our money now, and in exchange, we will be paid back the same sum in the future (debt maturity), plus interest payments while the debt is outstanding. This is investing in the debt of a business.
As a debt holder, if the business prospects turn bad, you are more protected than an equity holder, because you are in front of him or her in the lineup to claim the business' remaining assets. However, if the business becomes a super star, your upside is also limited to exactly the interest payments that were previously agreed to.
What is equity?
Equity is the partial ownership of a business. When a business issues equity, it is borrowing assets in exchange for a share in the business, and thus, profits.
There may or may not be regular payments in the form of profit sharing. The value of your share in the business may go up or down depending on the prospects of the business itself. In exchange for this additional risk, the equity investor typically demands much higher rates of return. Additionally, equity tends to be much more volatile in terms of pricing.
As an equity holder, if the business prospects turn sour, your share of the business could be worth zero. However, if the business becomes great, the upside is also unlimited.
Which one should I invest my money in?
As we saw above, investing in debt protects the principal itself very well, at the cost of severely limiting the upside potential. This implies that debt investments should be made when protection of principal is valued above all else (including inflationary effects).
Usually people who need principal protection above all else are investing for some soon-to-occur life event (like home ownership, a wedding, or a teenager's college education). For these kind of people, the additional risk of inflation eating away at your principal and below inflation interest rates plays second fiddle to principal protection. Thus, it is logical for these people to invest in debt. One thing to keep in mind here is whether or not you really ARE sure that inflation isn't a concern for your investment objectives.
We also saw that investing in equity has much more upside potential than investing in debt, and is much more likely (at current interest rates) to beat inflation. This doesn't come without costs, and two such costs are increased volatility, and potentially losing your investment completely if the business goes bankrupt. This implies equity investments should be very carefully selected, and only done for long term goals which allow the volatility to be smoothed out.
This means equity investments lend itself best to long term investors who are comfortable with taking some business risk in order to have a fairly good shot at beating inflation, as given the long investment duration, inflation erosion is a legitimate concern.