Bark beetles are specialized, with each species attacking only one or a few species of trees. Ponderosa pines are attacked by dark brown beetles the size of a grain of rice called western pine beetles.

“It’s been the most common combo in the state recently,” said Forest Service entomologist Danny Cluck, who supervises northeastern California. Western pine beetles also attack Coulter pines. And a different beetle species, mountain pine beetles, has caused extensive damage to sugar pines.

In the spring and summer, female western pine beetles fly around ponderosa pine stands looking for trees to lay their eggs in. As they start boring into a ponderosa, the tree oozes a sticky, viscous clear liquid called resin. If the tree is healthy, it can produce so much resin that the beetle gets exhausted and trapped as the resin hardens, which can kill it.

“The western pine beetle is an aggressive beetle that in order to successfully reproduce has to kill the tree,” said Forest Service ecologist Sharon Hood, based in Montana, a state that also has western pine beetles. “So the tree has very evolved responses. With pines, they have a whole resin duct system. You can imagine these vertical and horizontal pipes.”

But when the drought was underway and ponderosa pines weren’t getting much water, they couldn’t make enough resin to put up a strong defense. Beetles bored through the bark of millions of trees and sent out an aggregating pheromone to call more beetles and stage a mass attack.

Hundreds to thousands of beetles bore in and go straight to one of the tree’s most vital tissues: the phloem, a thin, spongy layer under the bark. The phloem (pronounced flow-em) moves nutrients from the tree’s needles, where sugars are produced through photosynthesis, down to its roots, where the sugars accumulate and help the tree grow the following spring.

Western pine beetles carve winding tunnels as they eat their way through the phloem and lay their eggs. Their meandering egg galleries have earned them the nickname of “drunken pine beetles,” said Ryan Bracewell, an entomologist at the University of California, Berkeley.

“That meandering behavior might be important in cutting off the phloem early on, when the beetles are attacking the tree,” said Bracewell.

This year, Moore’s aerial detection team — looking down from a small plane — has recorded fewer ponderosa pine deaths, but more fir mortality. Firs are attacked by beetles called fir engravers.

Information gathered from the air coincides with findings that scientists on the ground made this summer. Forest health scientist Jodi Axelson, a University of California extension specialist based at University of California, Berkeley, and her collaborators John Battles and Susan Kocher studied plots up and down the Sierra this summer, from Plumas National Forest in the north, to an area south of Sequoia and Kings Canyon National Parks.

“Overall, we saw very low levels of attacks by western pine beetles and mountain pine beetles,” said Axelson, “which is really fantastic from the point of view of tree mortality.”

She believes that above-normal rains last winter helped strengthen trees’ resin defense, which in turn led to a crash in these beetle populations.

Axelson and her colleagues did see fir engraver beetles attacking firs, but she said that these beetles are unlikely to cause extensive damage the way that western pine beetles did.

In the southern Sierra, where drought was the most severe and prolonged, Moore said that ponderosa pines “have basically been wiped out.”

As a result, this year “bark beetles don’t have anymore pines to kill in those areas,” Moore said.

Stanislaus, Sierra and Sequoia National Forests were the hardest hit areas.

In northeastern California, however, western pine beetles are still attacking ponderosa pines, said Cluck, though the situation has improved this year.

“I did see, in general, a lot of trees had taken advantage of the soil moisture from winter and early spring, when they were coming out of dormancy, and increased their resin production,” he said.

Dealing with millions of dead trees presents a challenge. Fewer than two percent have been removed, said Axelson, who belongs to the state Tree Mortality Task Force’s working group on forest health and resilience. Priority has been given to trees that could fall on power lines, roadways or buildings, she said.

Standing dead trees that have lost their needles don’t increase fire risk, said Axelson. But “once they fall to the ground you end up with these very heavy fuel loads,” she said, “and that undoubtedly is going to make fire behavior more intense.”

The recent fires in Northern California didn’t likely involve trees killed by bark beetles. Instead, they were fueled when the dry, warm Diablo winds ignited grass that had grown abundantly during the wet winter and dried out over the summer.

But it’s not clear what will happen when trees killed by bark beetles begin to fall over in the Sierra.