They say dogs are our best friends. Sometimes, they are our saviours.

In 1925, the small Alaskan town of Nome was in the throes of a deadly diphtheria epidemic. To save the town's inhabitants, 20 teams of sled dogs transported a vital anti-toxin over 674 miles (1,085km) of ice and snow, in just six days, through the most brutal winter conditions for decades.

Of the dogs that took part in the Nome Serum Run, the most celebrated were two Siberian huskies named Balto and Togo. Today dogs like these compete in epic sled races, outperforming many of the greatest human athletes. They are the fastest land mammal for distances over 10 miles (16km).

How do they do it?

Huskies were introduced from Siberia by a fur trader named William Goosak during the early 20th Century Yukon Gold Rush. Goosak had spotted the potential of sled dogs used by the Chukchi maritime people.

They outran many of the native dog teams

For thousands of years, Chukchi culture had used dogs for transportation across the Arctic tundra. Selective breeding had created the ideal sledding dog, perfectly suited to the freezing conditions and a life of hard work.

In 1909, Goosak raced his dogs in the 408-mile (657km) All Alaska Sweepstakes, a round trek between Nome and Candle that had long been dominated by teams of Alaskan Malamutes.

Goosak's "Siberian rats" were half the size of the Malamutes, but they outran many of the native dog teams, finishing a respectable third. Malamutes, bred for hauling freight, were stockier, but pound-for-pound the Siberians pulled faster.

Their abilities have their roots in their size and shape.

"Big dogs have longer gaits, covering more ground with each stride, but their mass makes them overheat," says Raymond Coppinger of Hampshire College in Amherst, Massachusetts, who is co-author of How Dogs Work. "The smaller Siberian Husky generates less heat, and with the same skin area for dissipation, they maintain temperature."

This might seem to suggest that sledders should use teams of Chihuahuas, but of course such dogs are so small that they would barely move the sled. Goosak's Siberian Huskies were the Goldilocks of racing sled dogs: not too small and not too big, and with just the right angle of pelvis, back length and shoulder width to allow for the longest possible stride.

Nome was cut off by the worst winter in 20 years and there were no local stocks of the anti-toxin serum treatment

They also loped, always keeping at least one paw in contact with the snow to haul the sled along. This was crucial.

Greyhounds are faster than Huskies, but they "bound" through the air. This is a great technique for sprinting, but disastrous for pulling a sled: the sled would pull them back every time they took flight. "Dogs that have flights are known as floaters and are ineffective sled-pullers," says Coppinger.

At the 1910 All Alaska Sweepstakes, a team of Siberian Huskies took first place. They were brought home by a Nome-based dog-sled driver, or "musher", called Leonhard Seppala.

His victory would be remembered 15 years later in January 1925, when Nome's Board of Health was confronted with a crisis: an epidemic of diphtheria.

Diphtheria is a bacterial infection that mainly affects the nose and throat. Left untreated, it can prove fatal. Nowadays it is rare because most people are vaccinated, but that was not the case in 1925.

The outbreak had come at the worst possible time. Nome was cut off by the worst winter in 20 years and there were no local stocks of the anti-toxin serum treatment. Without it, the town doctor predicted a mortality rate of 100%. The closest the serum could get by rail was Neana, 674 miles (1,085km) away.

Huskies can also use their large fuzzy tails to ensure that they breathe warm air at night

On 24 January 1925, Nome's Board of Health voted unanimously to use a dog-sled relay to transport the serum from Neana to Nome.

With the help of the US Postal Service, who regularly used dogs to transport mail across Alaska, 20 dog-sled teams positioned themselves along the route. Seppala was set to make the penultimate leg from Shatoolik to Golovin.

The entire route would ordinarily take the postal service 25 days, but that was far too long. In the brutal weather conditions, the serum would only last six. The dogs would have to complete the journey in less than a quarter of the normal time.

Their first challenge was simple: avoid freezing to death.

Siberian Huskies have lots of very fine, highly twisted secondary hairs, compared to other breeds, says veterinary pathologist Kelly Credille. These hairs form a special layer of their coat that traps warm air against the body, like a down jacket.

Many of the mushers who took part in the Nome Serum Run suffered frostbite in their hands and faces

Huskies can also use their large fuzzy tails to ensure that they breathe warm air at night. Each dog curls up into a wall and covers its nose with the fur of its tail, which acts as a warm air filter.

"We also found that Huskies are able to create a thick, protective coat that 'hibernates', rather than grows and sheds," says Credille.

Other dog breeds need regular haircuts because most of the hair follicles are actively growing - think of the need to shave poodles - whereas Huskies keep their hair in a resting state. This saves energy, says Credille. "Hair is made of precious protein and fats, and Huskies can avoid having to replace it until a time when the weather moderates and food becomes more plentiful."

Many of the mushers who took part in the Nome Serum Run suffered frostbite in their hands and faces. This is a consequence of how humans deal with extreme cold. To protect our vital organs, we direct blood into our core body. This leaves our extremities vulnerable.

Seppala found himself in a whiteout. He might as well have been blind

However, dogs' extremities do not lose as much as radiator-like human hands. Fused blood vessels in the footpad shift warm blood to the skin surface and hold it there, says Dennis Grahn of Stanford University in California. This helps maintain an even temperature just above freezing point.

Dogs' paws are also thickly furred, which may help prevent heat loss. In modern sled dogs, the areas most prone to frostbite in modern sled dogs are hairless regions like the nipples.

Leonhard Seppala's Siberian Huskies would have benefited from all these adaptations during the Nome Serum Run. By 31 January 1925, they had travelled 170 miles (274km) from Nome to meet the oncoming serum delivery.

With just two days before the serum expired, time was melting away, so Seppala made the decision to cross the unstable Norton Sound ice sheet. Then a blizzard closed in, and Seppala found himself in a whiteout. He might as well have been blind.

To survive, Seppala relied on his lead dog Togo to navigate around deadly open stretches of water.

Pulling behaviour is technically play, since there is no immediate reward

Togo was ideally suited to this, because dog whiskers - technically called vibrissae - can sense changes in airflow. The key to this is the sensors at the bases of the whiskers, known as tylotrich pads. Huskies have more tylotrich pads than other breeds.

Huskies are also rather intelligent, thanks to centuries of selective breeding. The Chukchi people needed dogs that could make split-second navigational decisions to safely transport them across the snow and ice.

The other thing the Chukchi needed from their dogs, and that Seppala and the other mushers relied on, was teamwork.

The key to creating effective sledding teams was to breed playful dogs.

"Pulling behaviour is technically play, since there is no immediate reward," says Coppinger. "Playfulness also provides the social facility to perform as a team, strengthens the bond between people and dog, and reduces inter-group aggression."

Balto is immortalised in a bronze statue in New York's Central Park

The Chukchi would have systematically chosen intelligent, playful dogs to sire the next generation of puppies. Aggression was largely bred out of the Siberian Husky.

The Chukchi's dogs were also encouraged them to roam and hunt, and were taken into people's homes to serve as companions - and dog-shaped blankets - for their children. This is reflected in their personalities. Today's Huskies exhibit low levels of social and non-social fear, and score highly for chasing, escaping and roaming behaviours.

It appears this selection has shaped the brain chemistry of today's sled dogs. Compared to more lethargic breeds developed for guarding livestock, such as the ҆arplaninac, Huskies have higher levels of a neurotransmitter called noradrenaline that is associated with general activity and exploratory behaviour.

Working as a team, Seppala's dogs found their way through the treacherous Sound. That brought the serum 91 miles (146km) closer to Nome.

Another driver named Gunnar Kaasen then stepped in, with a team of dogs led by a Siberian Husky called Balto. They delivered the serum to Nome with half a day to spare, saving 10,000 lives.

Siberian Huskies are no longer the champion racers of old

The story made Siberian Huskies famous. Balto is immortalised in a bronze statue in New York's Central Park; arguably rather unfairly, as he was only one of many dogs involved in the Run.

In 1930 the Siberian Husky was recognised as a breed by the American Kennel Club, which set out highly specific breed criteria to define them. Nowadays most "pedigree" Siberians are bred for the show ring, competing to be the best match for these criteria

"Breeds start from a very small population, and are terribly inbred," says Coppinger. "All Siberians trace back to just a few individuals at kennels in New Hampshire and Quebec. These were the dogs that Seppala called Siberians."

The shift to a pedigree breeding system has meant Siberian Huskies are no longer the champion racers of old.

"The type of dogs winning races today is not the purebred Siberian Husky, but the Alaskan Husky, [which is] the result of interbreeding between the best Siberians, Hounds, Malamutes, Border Collies and more," says geneticist (and champion musher) Heather Huson of Cornell University in Ithaca, New York.

Each dog burns through 10,000-12,000kCal of energy a day

Still, the Siberian Huskies have left a valuable genetic legacy. Huson has found that distance-running dogs carry a much higher proportion of Siberian Husky genes than sprint dogs.

The elite dogs that Huson studies compete in the Iditarod Great Sled Race, otherwise known as "The Last Great Race". Teams of 16 dogs race to complete a 1,000-mile (1600km) journey across Alaska between the towns of Willow and Nome, which takes 8-9 days. Temperatures range from -40C to highs around 0C.

During the race, each dog burns through 10,000-12,000kCal of energy a day. That far exceeds the highest values recorded for humans on endurance races like the Tour de France.

For a human to meet this energy demand, they would need to recruit every millilitre of blood in their body to get enough oxygen to their muscles. That would include blood that normally supplies the vital organs, causing those organs to virtually shut down.

Sled dogs have a set of adaptations to exercise that are not seen in humans

Athletes measure this using the "VO2 max", which is a person's capacity to get oxygen from the lungs to the working muscles at maximum effort. Chris Froome, the winner of the 2016 Tour de France, has had his VO2 max measured at 88.2. Sled dogs have been measured at 200.

This is partly because dogs have natural advantages over humans. Per cell, they have 70% more mitochondria, the body's power factories. What's more, they do not need to route blood from their vital organs, partly because all their training causes their hearts to grow by up to 50%.

But the question remains, how do they sustain these levels of exercise for so many days on end?

Michael Davis of Oklahoma State University in Stillwater has been researching this question for years. He says sled dogs have a set of adaptations to exercise that are not seen in humans.

Part of the dogs' secret is that they can eat a truly extreme diet

"The ability to continue day after day is all about getting energy from food, through the gastrointestinal tract and into the bloodstream and the cells," says Davis.

Glucose from food is stored in muscles in the form of glycogen, and released during exercise. "Exercise will normally deplete glycogen stores," says Davis, leading to an increase in stress hormones and cellular damage.

This means human endurance athletes - whether they are ultra-runners racing for hundreds of miles, or cyclists on the Tour de France - cannot keep going at the same rate as dogs. "They need rest to replace used glycogen... and to repair cellular damage," says Davis. "Amazingly, Iditarod dogs seem able to repair this damage, which we see on the first day of racing, on subsequent days of the run."

Part of the dogs' secret is that they can eat a truly extreme diet.

Since the dogs are burning 10,000kCal a day, they need to eat about that much to sustain themselves. That is the equivalent of 24 Big Macs a day: a lot of food to fit into a small dog.

It seems that, in racing dogs, the more fat the better

The solution is to cut down on the carbs and instead eat a lot of fat: it is the most energy-dense source of nutrition, which makes it the easiest way to get enough food into the dogs to prevent weight loss.

It turns out the dogs are very good at converting fat into glycogen. Racing dogs studied by Davis managed to maintain their muscle glycogen after repeated runs, day after day, even when their carbohydrate intake was just 15% of the total calories consumed.

A 1973 study determined that racing dogs on a zero-carbohydrate diet actually gain cellular advantages compared to dogs on a higher-carbohydrate mix of foods. They had more red blood cells and higher levels of haemoglobin, and were protected against mineral deficiencies that are commonly caused by exhaustive exercise. It seems that, in racing dogs, the more fat the better.

"You couldn't feed that diet to a pet dog, though, not even a pet Siberian Husky," says Davis's colleague Erica McKenzie of Oregon State University in Corvallis. "Any dog owner who has worried about their pet snaffling the Christmas turkey knows that some dogs can die from pancreatic inflammation if they suddenly ingest a large amount of fat."

Dachshunds are longer than they were 200 years ago, while pugs' noses are more squashed

When a pet dog consumes high amounts of fat, it shows up as fatty acids in the bloodstream. But in sled dogs, it does not.

Researchers had assumed the fatty acids were being transported directly from the blood into cells to be burned as fuel. That is what happens in highly-trained endurance athletes of other species. But Davis's latest findings indicate that sled dogs prefer to burn carbohydrates instead of fats, even at low exercise intensities that are typically fuelled by fat.

"Whenever we think we've got it figured out and there could only be one possible answer to their amazing endurance, the dogs find a different answer that we thought was impossible," says Davis.

Even today, racing dogs are still changing.

Visitors expect to see a Siberian in a dog sled team

The Siberian Husky does not exist as it once did, but then the same is true of any dog breed. Dachshunds are longer than they were 200 years ago, while pugs' noses are more squashed. Older breeds are born for their looks, paving the way for new breeds to appear and, in the case of the Alaskan Husky, take their racing crowns.

But there are still a few racing Siberian Huskies. Vickie Pullin works at Arctic Quest, a British company that takes people sled-dog racing. She trains some Siberian Huskies at her kennels.

"Visitors expect to see a Siberian in a dog sled team," says Pullin. "They look fantastic and are great with people."

Nowadays these dogs run in the context of leisure and fun. But their ancestors once saved a town from obliteration.

Join over five million BBC Earth fans by liking us on Facebook, or follow us on Twitter and Instagram.

If you liked this story, sign up for the weekly features newsletter called "If You Only Read 6 Things This Week". A handpicked selection of stories from BBC Future, Earth, Culture, Capital, Travel and Autos, delivered to your inbox every Friday.