polar bears generally don’t attack healthy walruses for the same reason that you wouldn’t just go attack a bull with your teeth anytime you got hungry- there’s a MASSIVE size difference between the two!
the very largest male polar bears still top out at less than half of what the average walrus weighs, and walruses have the further advantages of a thick protective layer of blubber and having two fucking katanas sticking out of their face. it’s generally not much of a contest.