The eruption last year of the Kilauea volcano in Hawaii produced the equivalent of 320,000 Olympic-size swimming pools of lava. Much of it ended up flowing into the Pacific Ocean, creating plumes of acidic, glassy steam in the process.

The eruption also unexpectedly coincided with an explosion in the population of phytoplankton, a diverse array of sea surface-dwelling, sunlight-drinking microscopic organisms. This massive bloom began just three days after lava from Kilauea first touched the sea. It expanded rapidly, stretching nearly 100 miles offshore in just two weeks. When the eruption dwindled and the lava stopped flowing seaward, the bloom quickly disappeared.

Scientists were initially baffled as to how 2,100-degree Fahrenheit, life-annihilating lava could trigger a biological bloom. A study published Thursday in Science reveals that it came down to a volcanic sleight of hand: As the lava tumbled to the ocean’s depths, it heated the deeper, nutrient-rich waters, allowing them to bubble up to the nutrient-starved surface. This provided a grand banquet for the phytoplankton, leading to their rapid proliferation.

Understanding how phytoplankton respond to their environment is a vital undertaking, as they are critical to the planet’s health. Phytoplankton form the foundation of marine food chains, and their seasonal blooms are responsible for more than half the photosynthesis, and the resulting production of oxygen, that occurs on Earth.