A lost parakeet in Japan was returned safely to its owner last week after it told police its home address. Why do captive birds mimic human speech, and how do they decide what to say?

They’re trying to fit in with the flock, and they’ll say whatever it takes. Parrots are among a handful of animal families that possess an aptitude for vocal learning, meaning that they can form new sounds based on experience. Most types of birds, and many other animals, are hard-wired to make a few specific calls, perhaps with slight variations. A mourning dove, for example, pretty much always sings like a mourning dove. But parrots and mockingbirds, among others, can tailor their utterances to their audience.

In the wild, flocks of parrots don’t talk like people, but they do seem to develop distinct local dialects, and mated pairs may even sing unique duets. It’s unclear exactly why they evolved this capability, but research suggests they use it to tell members of their group apart from members of rival groups. Birds seem more likely to respond to calls that are familiar to their own, and they ostracize individuals that don’t speak their language, so to speak. This may allow them to keep untrustworthy newcomers from joining their clan. But if the dialects do serve as a form of immigration control, learning the language seems to be a path to citizenship. In one experiment, a group of parrots from one Costa Rican flock was transplanted to a more northerly flock that showed different vocalization patterns. About half flew right back home, but the rest stayed and formed a sort of immigrant enclave with its own dialect. One even learned the northern tongue and ingratiated itself with locals.

According to this theory, birds that are raised in captivity might mimic their human owners as a way of gaining acceptance as a member of the family. If they hear “pretty bird” a lot, they’ll interpret that as a call distinct to their flock, and try making it themselves. If the parrot gets no response when she squawks, but gets lots of attention or treats when she makes humanlike noises, she has an extra incentive to practice forming words and phrases.

Whether parrots can ever understand what they’re saying is a matter of debate. Researcher Irene Pepperberg trained an African Grey Parrot named Alex to speak with a vocabulary of some 100 human words. Over time, he learned numbers and phrases as well, and when shown a toy, he could correctly identify its name, color, and shape. Skeptics have suggested that Alex’s abilities might have been a product of the “Clever Hans” effect, in which an animal gives correct responses based on its trainer’s body language, as opposed to genuinely understanding the question. Others wonder whether Alex happened to possess a unique language capacity.

Got a question about today’s news? Ask the Explainer.

Explainer thanks Irene Pepperberg of Brandeis University and Timothy Wright of New Mexico State University.