The blue whale is, famously, the largest animal to ever live.

Think for a minute what that means. According to some estimates, there are about 7.7 million animal species alive today, and who knows how many more have lived on Earth since the first animals appeared about 650 million years ago.

Those species include elephants, whale sharks, polar bears, tyrannosaurs, and titanosaurs – all species with a reputation for large size. But not one of them is, or was, as large as the blue whale.

How did these leviathans get so record-shatteringly big? There are a number of ways to look at this question.

Back in 2011, a team of scientists looked at the size and age of fossils and ran a series of computations to determine the maximum rate of evolution in mammals. They learned that it has taken about five million generations for whales to increase their body mass 5,000 times.

Something really, really small aided whales in their journey to getting really, really big

The fossil evidence suggests that some land animals take about twice as long to go through the equivalent amount of bulking up. So not only did whales get big, but they did so extraordinarily quickly.

"We think there are two key reasons why whales can evolve big size faster than other mammals," says lead author Alistair Evans, an evolutionary biologist at Monash University in Australia.

"The first is because they live in water their body doesn't have to hold up their weight, so there's a lot less stress on a big body in water than there is on land." In other words, physics played a big role here.

But there was also something else, says Evans. Something really, really small aided whales in their journey to getting really, really big.

Blue whales are baleen whales: they belong to the Mysticeti, a suborder of whales that can filter tiny organisms out of the sea with their bristly baleen mouth combs. The earliest baleen whales evolved about 38.8 million years ago, when the filter-feeders first diverged from the toothed whales.

Gigantism may have evolved independently in baleen whales up to four times

You might expect that these early Mysticeti were giants, similar to modern species like the blue whale.

But according to a study published in October 2016, the suborder's most recent common ancestor was no more than 5m in length. That is not even half the length of your average school bus, the universally-accepted comparison measurement for Things That Are Big.

Clearly, something must have happened to select for larger Mysticeti between then and now. Even the pygmy right whale, the smallest of the living baleen whales, can grow up to 6m long.

In fact, according to lead author Cheng-Hsiu Tsai, a vertebrate palaeontologist at the National Museum of Nature and Science in Japan, gigantism may have evolved independently in baleen whales up to four times.

That means gigantism is not a fluke, but a trend.

Compared to the rest of the whales, baleen whales are much more likely to grow huge. Of course, plenty of other species of baleen whale both large and small have emerged and disappeared over the last 38.8 million years, but looking at the ones that remain should tell us something about what works for these whales.

There are several reasons why an animal would tend towards gigantism. Superior size is generally a good way to ward off predators, compete for mates, endure periods of resource scarcity, and conserve heat. Staying warm is extremely important for aquatic creatures.

A few tens of millions of years before baleen whales got started, Earth's seas were emptied of most species

But there are also problems associated with being colossal. Namely, how do you find enough fuel to feed an engine that big? And that brings us back to baleen.

When the Mysticeti evolved these long, keratinous filters, they gained access to a superabundant new food source, says Evans.

Instead of having to spend energy hunting a single prey item like a fish or seal, energy that could be wasted if it escapes, the baleen whales simply glide through dense clouds of krill like aquatic combine harvesters, swallowing up to 457,000 calories in one gulp.

Animals with this ability would also have been more suited for long, trans-global migrations, which some scientists believe may explain why larger whales survived while countless smaller species disappeared over the millennia.

But there is one final contributor to blue whale gigantism that cannot be overlooked. A few tens of millions of years before baleen whales got started, Earth's seas were emptied of most species.

"Think of this: the large, marine reptiles in the Mesozoic essentially occupied the similar niche as the most successful aquatic mammals," says Tsai.

If something – most likely a comet or asteroid – had not come along and removed all of these marine monsters from the equation about 66 million years ago, then the blue whale's ancestors might never have established a foothold in the oceans at all.

I think it's unlikely that the largest animals we know of are at the maximum

Similarly, once the mammals were there, they were able to exploit the niches formerly locked down by giant sea-dwellers like plesiosaurs and mosasaurs.

It is also important to remember that a similar deus ex machina could just as easily await the blue whale. It took millions of years of evolution to build the world's largest animal, a feat owed as much to its habitat and lifestyle as to its origin story. Then, in fewer than 100 years, humans hunted these behemoths to the edge of extinction.

It has been illegal to hunt blue whales since 1966 and, thanks to this protection, blue whale populations are generally on the rise. However, there is some evidence to suggest that climate change will alter Earth's oceans in ways that are not very favourable for krill. That means the blue whale's continued survival is anything but certain.

If they can stick around, blue whales and their kin may continue to get even bigger.

"I think it's unlikely that the largest animals we know of are at the maximum, either on land or in the sea," says Evans.

None of us will be around to see it, of course. But given the rates of evolution Evans estimates whales are capable of, it is entirely possible that the largest animal to ever live has not even been born yet.

Join over six 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 bbc.com 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.