The tranches of CDOs are named to reflect their risk profiles; like, senior debt, mezzanine debt, and junior debt, depending on the individual product, the actual structure will change.
When the credit rating is high the coupon rate will be low. in case of loan default, from the collateralized pool of assets, the senior bondholders get paid first.
Then in the other tranches, according to their credit ratings, the bondholders will follow, finally, the lowest-rated credit will be paid last.
Since they have the first claim on the collateral the senior tranches are the safest.
The senior debt offers lower coupon rates even if they are rated higher than the junior tranches.
On the contrary, to compensate for their greater risk of default the junior debt offers higher coupons /more interest, but because they are riskier, they generally come with lower credit ratings.
P.S :
Senior debt – has a higher credit rating, but lower interest rates.
Junior debt – has a lower credit rating, but higher interest rates.