Head-bobbing is a common trait among ground birds like pigeons, pheasants, partridges, and chickens. Ornithologists call it the "optokinetic response," and it seems to help the birds' vision. Remember that a pigeon's eyes are set on the sides of its head, so that when it's walking around, the world sort of sails by in a confusing blur, like landscape viewed from a moving train.
The optokinetic response appears to compensate for this. Next time you're down at St. Mark's Plaza, take a look: The pigeon has a kind of inchworm gait. It jerks its head forward, then brings its body to meet it, then jerks its head forward again. The net result: The bird gets a series of fixed snapshot images, rather than a long, continuous blurry one. (A twirling ballerina uses a similar strategy, keeping her head aimed at a fixed point while her body rotates.)
Back in the late seventies, Barrie J. Frost, a visual neuroscientist at Queens University in Kingston, Ontario, put pigeons on a tiny treadmill. They walked, but they didn't move relative to their environment-and they stopped bobbing. Draw your own conclusions; to me it's scientific proof that if you're going to get anywhere, you have to stick your neck out.