In simple words, if an investment is held till its maturity date, the rate of return that it will generate will be Yield to Maturity. YTM is the estimated internal rate of return earned by an investor who buys the bond today at the market rate on the assumption that it will be held until its maturity date with all payments made as scheduled and reinvested at the same rate.
For example, for an investor who buys the bond today at the market rate and the bond is purchased at less than its maturity value; the yield to maturity includes the annual interest plus the gain as the bond increases from the investment amount to the maturity value. For instance, say an investor buys a bond at Rs.92/- that matures in 3 years, whose par value is Rs.100/- and pays an annual coupon of 7%. The yield to maturity includes the annual interest plus the gain as the bond increases from the investment amount to the maturity value (Rs.100-Rs.92= Rs.8/-) plus interest received is Rs.7*3=21. So yield to maturity of that bond is Rs.29/-
In another example, an investor buys a bond at Rs.110/- that matures in 3 years, whose par value is Rs.100/- and pays an annual coupon of 10%. The yield to maturity includes the annual interest plus the loss as the bond decreases from the investment amount to the maturity value (Rs.110 -Rs.100= (-Rs.10/-).
Hence YTM is also known as redemption yield which is considered a long-term bond yield but it is expressed as an annual rate.