On long distance voyages pigeons calculate the distance they need to fly by comparing the position of the sun with their internal clock. Pigeons have two internal magnetic compasses that they use to find direction with and to find their way home. All pigeons are born with the ability to find their way home.
Pigeons have been taken as far as 1100 miles from home and released and they returned home. It is also believed that pigeons use familiar landmarks in their home area to find their way back home. It is also now believed that pigeons use their sense of smell to find their way back home.
I don't think you could call a pigeon bird brained because the pigeon has to be a pretty smart bird to do what it does.