It is one of earth's most spectacular migrations and is often hailed as one of the wonders of the natural world.
Now scientists from Bangor and Bristol universities have helped uncover the reason why tens of millions of crabs on Christmas Island are able to travel several kilometres to breed each year.
During the monsoon season, the red crabs scurry simultaneously through rainforests to the Indian Ocean.
Scientists say a hormone is key to the usually sedentary species' sudden move.
The bright red land crabs are native to the small island, which is an Australian territory but is near Indonesia, and there are an estimated 120m living there.
They dig burrows in almost every square metre of available soil or live in deep crevices in rock outcrops. For most of the year, a crab will settle in one place, living in their burrow.
But during the monsoon season, in late November or early December the crabs - officially called gecarcoidea natalis - simultaneously undergo a breeding migration.
They travel several kilometres over a few days, through the rainforest, to eventually reach the sea where they mate and spawn.
Scientists had suspected a hormone was responsible for the dramatic switch in the crab's behaviour, but little was known about it.
But after receiving funding from the Natural Environment Research Council, teams from Bangor and Bristol universities undertook a three-year research project investigating the mechanics behind the dramatic migration.
"The migration is extremely energetically demanding, since the crabs must walk several kilometres over a few days," said Professor Simon Webster, of Bangor University's School of Biological Sciences.
"During the non-migratory period, the crabs are relatively inactive and stay in their burrows on the floor of the rainforest, only emerging for a brief period at dawn, to feed.
"The behaviour change reflects a fundamental change in the metabolic status of the animal."
The research found that the hormone - crustacean hyperglycaemic hormone - is of critical importance in enabling the crabs to make the most efficient use of their stored energy in the muscles - called glycogen - and its conversion to glucose to fuel the migration.
As part of the study, the teams developed very sensitive methods for measuring the small levels of hyperglycaemic hormone in the blood of the crabs.
Prof Webster added: "We then travelled to Christmas Island to work in the rainforest, in both dry and wet seasons, taking blood samples from crabs during day and night-time, whilst getting eaten alive by mosquitoes, and monitoring the crabs' behaviour in their natural environment."