Convertible debt is when a company borrows money from an investor or a group of investors and the intention of both the investors and the company is to convert the debt to equity at some later date. Typically the way the debt will be converted into equity is specified at the time the loan is made. Sometimes there is compensation in the form of a discount or a warrant. Other times there is not. Sometimes there is a cap on the valuation at which the debt will convert. Other times there is not.
There are a number of reasons why the investors and/or the company would prefer to issue debt instead of equity and convert the debt to equity at a later date. For the company, the reasons are clearer. If the company believes its equity will be worth more at a later date, then it will dilute less by issuing debt and converting it later. It is also true that the transaction costs, mostly legal fees, are usually less when issuing debt vs equity.
For investors, the preference for debt vs equity is less clear. Sometimes investors are so eager to get the opportunity to invest in a company that they will put their money into a convertible note and let the next round investors set the price. They believe that if they insisted on setting a price now, the company would simply not take their money. Sometimes investors believe that the compensation, in the form of a warrant or a discount, is sufficiently valuable that it offsets the value of taking debt vs equity.