Why do rising interest rates negatively affect bonds?

Sam has a bond paying a 2% coupon.

The Fed raises rates to 3% and suddenly, Sam’s bond is not as attractive, so the price of his bond drops to reflect the new yields.

Along comes Bob – he can now either buy the new 3% bond, or buy Sam’s 2% bond but at a discount to ultimately yield 3%.