Credit risk is the risk that the issuer of a debt security such as a bond will default on the payments due.
Credit risk is one of the main determinants of the price of a bond. The price of a debt security can be explained as the present value of the payments (of interest and repayment of principal) that will be made. This leaves the question of what determines the discount rate.
This can be decomposed into two elements:
The risk free rate depends only on the currency and the timing of payments.
The risk premium depends on the level of credit risk and the correlation of the the credit risk with the risk of holding other investments (in accordance with the CAPM).
Credit risk is also an issue for lenders such as banks. In this context the key is the risk of losses to the bank so correlation with the bank's other lending is what matters, not correlation with debt available in the market.