In a corner of Sequoia National Park in California, Sierra redwoods stick out like colossal cinnamon sticks among the more common pines, firs and incense cedars. Nate Stephenson, a U.S. Geological Survey ecologist, makes his way up a hill, stepping over fallen logs. He stops in front of a small, dead red fir, which a hanging metal tag identifies as “189.” Stephenson points out a section of its trunk where the USGS field crew cut away the bark, revealing the squiggly signature of the fir engraver beetle scrawled across the brown sapwood. Number 189 is just one of the more than 100 million trees researchers estimate died during California’s five-year drought, which ended this spring.

The drought—one of the state’s worst in centuries—devastated the park’s forests. The dead trees raise a series of questions for Stephenson: Why did some trees perish when others lived? Why did some parts of the forest suffer more than others? Why 189 and not its neighbor? “It’s a detective game,” he says. As the world warms, the answers could be critical in helping save forests struck by increasingly severe droughts. To predict the effects of these extreme events, scientists need to better understand how forests work normally—and for ecologists like Stephenson, that means figuring out why trees die.

Stephenson and his colleagues have spent decades studying thousands of dead trees—digging up roots to check for fungus, scraping away bark to search for beetle tunnels, looking for patterns among the dead. Since 1982 field crews have spent summers visiting plots scattered around Sequoia National Park. Each year they record the condition of all the trees in those plots; every five years they measure the diameter of the trunks. If a tree dies, they give it an autopsy. All told, they have tracked the lives of more than 30,000 individual trees.

For most of the years that scientists monitored it, tree 189 hardly changed. Between 1982 and 1987 it grew two centimeters, and then it stopped growing for the next 15 years. In 2000 it started to lean, after a neighboring tree toppled over and hit 189 on the way down. It also became infested with parasitic dwarf mistletoe. The next year brown felt mold covered its needles and the year after that some of its foliage yellowed. Then its trunk started weeping pitch. For the next decade it sputtered along, sickly and barely growing. Then, in 2012, the drought struck. In 2016 tree 189 died. Field crew members cleared the soil from its roots and found root rot, which had weakened it. But it was tunneling engraverbeetles that ultimately doomed the fir.

There is immense value in having such a detailed history of an individual tree, says Beverly Bulaon, a U.S. Forest Service entomologist who helps train USGS field crews. Tracking a tree year by year lets researchers see exactly how it grows weaker and more vulnerable, as ailments and environmental stresses accumulate. Knowing this progression can help scientists understand which other trees are at risk, she says.

The stories of these trees are even more useful when studied as a collection. In a 2016 study published in EcologyUSGS ecologist Adrian Das, Stephenson and their colleague Kristin Davis of Colorado State University’s Natural Resource Ecology Laboratory tracked the lives of more than 23,000 trees in plots throughout Sequoia National Park over a 13-year period. On average about 2 percent of the trees died each year, with insects or pathogens destroying more than half of them. This was a surprise, Stephenson says—foresters have assumed that most trees that die under normal conditions simply lose the competition for light, water or nutrients.

The drought hit the year after the period covered in the Ecology study. In general, Das says, the organisms fatal to trees during the study were the same ones that killed them en masse during the drought. “It’s not a new suite of organisms,” he says. “They just start operating at different scales and in new ways.” Some of the culprits are well known, such as the pine beetles that boomed in population during the drought, Das notes. But less is known about many other organisms, such as another type of beetle that suddenly began assailing incense cedars during the drought or the weevil that started attacking young pines. Without baseline information about what killed trees before the drought, Das explains, ecologists would have overlooked these details.

Forests face a tough future, says David Breshears, an ecologist at the University of Arizona who was not involved in the study. Scientists predict hotter and deadlier droughts will strike forests as the climate changes. Many places have already experienced tree die-offs like California’s. Researchers have also found that over the last few decades the rate of trees dying under more normal conditions has increased dramatically in many parts of the world—including in Sequoia National Park. They think the rise in tree deaths is likely caused by stress due to insufficient water, and also perhaps because of escalated attacks by insects and pathogens. “There’s a lot of evidence that suggests we’re going to start losing a lot of trees,” Breshears says.

In Sequoia National Park Stephenson continues through a plot, passing trees 149, 6426, 265 and hundreds of others, living and dead, all with their dangling metal tags. He feels like the forest looks about the same as it did when he helped tag this plot decades ago. But it has changed—trees have grown and died, and new ones have sprouted—shifts that would have gone largely unnoticed without tagging.

Forests will continue to change in the future, likely faster than ever—but ecologists may still be able to protect especially valuable forests from climate change and other threats. In some places that might mean thinning trees—in others, watering trees or spraying them with pheromones that repel specific types of beetles. The strategy will depend on identifying which trees are most vulnerable, and to what. “This information we’re getting on what’s killing trees could help us buy time,” Stephenson says. “I don’t think we can stop change from happening but if we can ease a transition rather than have it all at once, probably everyone is going to be happier.”