A convertible bond (convertible) is a bond that can be exchanged for shares on or before maturity. A convertible bond is equivalent to a straight bond plus a warrant: in other words, it contains an embedded option.
Convertibles give bond holders a hedge against the risks arising from agency issues. A that has issued bonds may choose to follow a riskier strategy. If the strategy works, the equity holders will keep the profit. If the riskier strategy fails, then bond holders face higher default risk. As the shareholders control the company, they may well choose such a riskier strategy. In this case holders of convertibles can choose to convert.
Debt covenants are also used to control this risk but warrants and convertibles are simpler and tackle the problem at its root (by removing the incentive) rather than trying to impose controls.
Another way of looking at convertibles is as shares with a long term put option. The holders of convertibles get all the benefits of shares (except for the dividends and voting rights before conversion), but they get interest payments until conversion (more than making up for dividends). In addition, if the shares under-perform, they can choose to keep the bonds. The equivalence is not exact (as it is to a bond plus warrant) but it does reflect a possible reason for buying convertibles.