Where birds go during the winter, and how they get there, has baffled people in the northern regions of the world for centuries. Aristotle suggested that birds changed species with the seasons; that redstarts turned into robins and garden warblers into blackcaps as the weather cooled. As late as the 19th century, some naturalists thought birds hibernated.

The reality seems almost as crazy as birds morphing species throughout the year. Thousands of bird species (at least 40 percent of the world’s birds) travel between summer breeding grounds and winter enclaves, sometimes crossing continents and oceans to do so. For example, every year, the arctic tern travels 44,000 miles on a meandering path between Greenland and Antarctica. However, seasonal migration is not restricted to flying birds. Emperor penguins march across 70 miles of ice each year from the sea to their breeding ground.

There are a few theories about how birds find their way between their seasonal homes, and there are still some mysteries surrounding how exactly their honing systems work. For many birds, however, migration is an instinct, a journey their bodies are prepared to take when the time comes.

As sunlight hours wane in the fall, photoreceptors in songbirds’ brains respond, setting in motion hormonal changes that cause the birds to molt, eat more, and start jonesing for the open skies. To fatten up for their arduous journey across the Caribbean Sea, for instance, bobolinks, a kind of songbird, up their food intake by almost 40 percent in order to balloon to up to 150 percent of their summer body weight. Along with the desire to gorge comes a restlessness to take flight after sundown and to keep flying throughout the night. It’s known by its German name, zugunruhe. Even captive birds, who have no reason or ability to migrate, feel it.

“As songbirds take to the sky just after sunset, the captives begin flitting against their cages, too,” ornithologist Miyoko Chu explains in her book Songbird Journeys (an invaluable resource for this article). “Their restlessness continues every night, finally ceasing at about the time when the wild birds finally reach their wintering grounds.”

The direction of their flight, too, is instinctual. One classic study from 1978 found that garden warblers raised in captivity flew in the same cardinal direction as their wild, migrating relatives, even though the captive birds could not see the sky. Some migratory birds can sense magnetic fields and use them to navigate, though how exactly they do this is still somewhat mysterious. Bobolinks, for one, have magnetite in their nasal tissues, and studies of their brains show that neurons associated with vision light up when magnetic fields change. In 2007, researchers at the University of Oldenburg found that garden warblers also seem to be able to see magnetic fields. This may be how the garden warblers in the 1978 study knew even without seeing the sky the direction in which they needed to migrate.

That direction is partially a matter of genetics, resulting in sometimes inefficient routes. In 2008, researchers Peter Berthold and Andreas J. Helbig crossbred birds with different migratory patterns and found that the offspring could not figure out where to go when they migrated. The young birds tried to fly a route halfway between what each of their parents would have taken, following contradictory instincts.

The route itself is not preordained, though. Birds learn how to get to their summer and wintering grounds over time, and younger birds can get lost. In addition to using the Earth’s magnetic field to orient themselves, some birds use the Sun and the stars. Songbirds can see polarized light patterns and use those to find their way, too. According to a 2013 study published in Biogeosciences, pigeons may be able to navigate using their sense of smell, by memorizing certain odors in the wind. If they get lost, they can retrace their flight by flying towards odors they’ve smelled before, in the opposite order from when they were headed out the first time.

Still, some species are worse at migration than others. Whooping cranes, for instance, learn migration routes from older birds. For 15 years, a Canadian charity attempted to teach captive whooping cranes how to migrate from Wisconsin to Florida for the winter by having the youngsters follow ultralight planes because the orphaned birds otherwise wouldn't know to leave the Midwest for sunnier digs, or where to go. (The program was recently shut down after the federal government pulled its funding.)

Environmental conditions can also influence migration. Research on thrushes conducted by Biological Station Rybachy in Russia found that though they will fly through lightning storms, they only take off if weather conditions at sunset aren’t too cold or windy. If it’s colder than 69°F or if wind speeds exceed 6 mph, they’ll hunker down for the night. And if they aren’t fat enough to sustain the journey, they’ll rest up and eat until they gain some weight.

Because there are only so many optimal migration paths, many bird species in the Western Hemisphere have evolved to migrate along some of the same routes, converging on their way between North and South America at several points where wind patterns and other factors might give them an edge in completing dangerous ocean crossings.

Often, birds end up returning to the exact same territory each year. They may even return to the same area where they were hatched as chicks. Research indicates that up to 60 percent of migratory songbirds return to the same place each year. So if you see a warbler around, say "hi." It’ll probably be back again next year.