The US has excellent credit because it has largest military and is the dominant global player. That makes money parked in US T-bills safe. Liquidity and good, healthy economy (but not perfect) helps.
The big military only works in US’s favor because of the US commitment to pay.
A country with a reputation for stealing people’s money does not attract foreign investment no matter how big the military. Does a robber seem trustworthy to you just because he’s got a big gun?
The US has excellent credit because it has largest military and is the dominant global player. That makes money parked in US T-bills safe. Liquidity and good, healthy economy (but not perfect) helps.