I had a cat scare off a moose.Hard to anthropomorphize cat behaviour. It's not unambiguously clear to me if the cat was defending, or if it thought there was a fun game being played.
Family pets will defend their owners, probably because of the instinct of altruism, territorialism, and mutual cooperation between animals living in groups, colonies, packs.
I saw video of a cat run off a pit bull seemingly in defense of one of its owners.