For example, a cactus produces shallow roots that allow it to rapidly absorb any rainfall in the desert and specialized cells in its stem that swell to store that water. Instead of conducting photosynthesis, the leaves are modified into spines that protect the cactus from animals that may try to eat it. Photosynthesis occurs in the outer layers of its succulent, green stem.