The payments remaining on an interest-paying bond or instrument, plus principal, are totaled up and then annualized, and this annual rate is the yield to maturity.
Yield to maturity is a calculation that helps an investor decide if he or she is getting a good deal. If yield to maturity is greater than the coupon rate, the bond is trading a a discount. If yield to maturity is less than the coupon rate, it is selling at a premium. If they are equal the bond is trading at par value.
This calculation is also useful for zero-coupon bonds so that an investor gets a better idea of how it compares to other investments. If a bond is callable the investor will do a similar calculation to determine the yield-to-call. The yield-to-maturity assumes the investor holds the bond until maturity.