The chattering sounds that a cat makes when she sees a bird through the window are thought to be a vacuum activity. Vacuum activities occur when the cat is unable to fulfill her natural hunting proclivities. Another vacuum activity is the sudden mad dashes around the house that many cats engage in with no apparent provocation.
When a cat sees a bird or other prey animal that 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.