How can an animal be both predator and prey?

Ever see a cat watching a bird eating a worm?