Life in the Sonoran desert, like life anywhere, isn't always easy. But going without rainfall for up to two years or more is pretty extreme! Different plants adapt to these extreme arid conditions in different ways. During dry times a plant's water reserves can evaporate through the leaves faster then the roots replenish it. Many plants are adapted to drop ALL their leaves when these conditions exist. They simply re-grow them when conditions improve.
This picture shows two different trees of the same species, Bursera microphylla, also known as "Torote Colorado" ("red bull" in Spanish). Both trees are growing in the same arroyo only a few hundred meters apart, yet one is bare from lack of water and the other is thriving with a full coat of green leaves. What gives?
Perhaps the root system of the leafy tree has managed to tap an underground supply of water not available to the other. Perhaps local topography has played a role in minimizing the effects of evaporation for the green tree. Perhaps... well, perhaps that is just the luck of the draw and in the desert, survivors are the ones that can take the good with the bad, and the bad with the good.