Whales today are bigger than ever before. Now, we know why.

A big solution to a cold problem.

It might not seem like it, but we live in a world full of giants. Blue whales are the largest animal ever to move across the planet, with the biggest measuring in at over 100 feet long and weighing hundreds of thousands of pounds.

Blue whales are part of a group called baleen whales, distinguished today by their baleen, a screen of cartilage that hangs down from the roof of their mouth in place of teeth used to filter prey out of the water. Baleen whales lost their teeth gradually, replacing them fully with baleen about 20 million years ago. We know a lot about baleen whales, which include blue whales, humpbacks, and right whales among others, but why—and when—did they grow into giants?

In a paper published Tuesday in the Proceedings of the Royal Academy B, researchers examined the fossils of over 140 baleen whales representing 13 modern species and 63 extinct species to figure out when and why they got so large.

“We’re fortunate in that baleen whales have a dense fossil record that allows us to address this question,” says co-author Nick Pyenson, curator of marine mammals at the Smithsonian National Museum of Natural History.

By looking at the fossils, Pyenson and his colleagues were able to show that up until recently, baleen whales stayed relatively small, with average lengths between 16 and 32 feet. That’s still large by land-animal standards, and researchers think that both toothed (think orcas) and baleen whales went through a growth spurt millions of years ago when their ancestos moved from the land to the sea. But around 4.5 million years ago something changed, and baleen whales began to grow dramatically. The fossil record shows that this size shift happened in several species of whales all at around the same time period, which indicates that there was probably an external factor involved in the sudden growth.

Around that same time period, Earth was going through the start of an Ice Age. Ice sheets, ice caps, and glaciers froze into place, altering the ocean currents. Pyenson and colleagues think that this was the shift that supersized the baleen whales.

The change in climate during that time period also changed the circulation of the oceans, creating areas where cold, nutrient-rich waters rose, concentrating zooplankton (tiny sea creatures that many baleen whales feed on) in biological hotspots.

While the amount of prey may have stayed the same, the distribution shifted from being spread out across the oceans to concentrated in a few spots that appeared seasonally. Suddenly, it made sense to have a larger body, capable of traveling thousands of miles to reach the marine feasts laid out in these new areas. The researchers think that smaller whales would have lacked the resources to make those long and perilous journeys, and being larger also allowed them to take advantage of the dense patches of food that were now available.

Today, Pyenson says that large baleen whales are living on a knife’s edge. Ocean acidification is starting to alter (and in some cases damage) the zooplankton that many baleen whales rely on to survive. “There may be winner and losers,” Pyenson says. Some of these sea-faring giants might perish as the world once again changes around them. Others might be able to adapt and thrive.

“Overlain on all of that is the impact of whaling,” Pyenson says, pointing out that during the time when humans aggressively hunted whales, exploiting them as a natural resource, baleen whales were generally targeted the most. ”That may have had profound ecological consequences that we don’t know yet. What happens when you lose that much biomass in an ocean? We’re still finding that out.”