Principal risk from interest rate hikes on short term bonds is nowhere close to what the stock market is subjected to. Let’s say you’ve got a 5 year bond yielding 2%. An immediate hike in interest rates (with no warning) by 1 point will discount the NPV of your bond by 5%. If it’s immediately hiked up another point, it’s 11%.
Neither of those two scenarios would apply in real life because in real life, central banks don’t raise interest rates that quickly. Fed funds is currently between 1 and 1.25%, with potential quarter-to-half point increases later this year, which is already baked into the price of any bonds with a maturity of over a year.
Yes, bonds are subject to default and interest rate risk. As it applies to short term investment grade bonds, both risks are small and vastly smaller than the risk that the stock market is subjected to.