Ethologist Desmond Morris describes the chattering sounds a cat makes when she sees a bird through a window as a “vacuum activity.” Vacuum activities occur when the cat is unable to fulfill her natural hunting drive.
When a cat sees a bird or other prey animal she can’t get to, she tenses her body and chatters her teeth as a substitute for delivering the killing neck bite. This action likely represents a combination of excitement at seeing an enticing prey animal and frustration at having the hunting drive thwarted.
Playing with cats using toys that simulate prey (such as a fishing pole toy with a cloth mouse or feathers at the end of a string) enables them to practice their hunting skills without killing anything.
For more articles on the way cats think and the reasons they do the things they do, visit the main Cat Psychology, Communication, and Behaviour page. For a full list of cat articles, see the main Cats page.
Reference: Morris, D. (1987). Catlore. London, UK: Jonathan Cape Ltd.