Whether it is presented as letters (eg AAA), letters & numbers (eg Baa 1) or purely a number (564/1000), an entity’s credit rating is a key value.
Lenders in particular use this value to assess not only the safety of their commitment, but also the interest rate they want as a return via the credit risk premium.
The credit rating agencies who assess government & corporate debt are S & P, Fitch & Moodys. The equivalent entities that assess individuals include Equifax & Experian amongst others.
For the former, the agencies consider factors categorised into for sections:
Evaluation of Co Mgt
Some issues maybe out of the control of the entity. Look how the pandemic effected the airline, travel & restaurant industries.
However, the factors that they can influence they should do so. For instance, paying interest on debt on time & redeeming on the maturity date are what the credit rating agencies want to see.
(BTW the photo below is my current credit rating )