Well, treasury, i.e. state bonds, are considered virtually riskless. That's because a state can only default (not pay up) on them if it declares national bankruptcy. That does not happen very often, and if it does, everyone has bigger problems than their bond not being paid. Also, yields on T-bonds almost don't change. Usually, the state declares a certain yield or binds it to its economic performance. Even in that case, the economy of a whole country does not change so dramatically.
Corporate bonds, on the other hand, are usually affected by the company's profitability. Sometimes not directly, but a company will not issue a bond with a 10% coupon if it is currently in the red. Next year, it may have a 10% net profit and issue more interesting bonds with higher coupons. And then down again, and up, and so on, depending on the company's results.