The whole of the barrel cactus is designed to retain water. Spines serve not only as a defense mechanism against hungry desert animals, they also provide some shading to the plant. The stem is covered in a thick, waxy coating that seals the plant, protecting it from excessive evaporation. The root system of a barrel cactus is shallow, but large and net-like, enabling the cactus to catch as much water as possible during desert rains.
The shape of the barrel cactus is a precision design, directing any dew or rain directly to the roots of the plant. Up to 25 accordion-style folds effectively decrease the amount of surface area of the plant that is exposed to the harsh conditions of the desert. Barrel cacti also grow at an angle, often tilted to the south in order to partially shade themselves and prevent sunburn.
The barrel cactus is one of the best water retainers among plants, thanks to a gelatinous pulp that can absorb a significant amount of water. The accordion-shaped ribs are designed to expand as water stores increase and shrink back when water is less abundant. This combination of water-retaining pulp and flexible skin allows the cactus to hold an impressive amount of water, with 5- to 6-foot barrel cacti often weighing several hundred pounds.
Perhaps the most impressive adaptation of the barrel cactus is an adaptation known as Crassulacean Acid Metabolism (CAM). Instead of normal photosynthesis, in which all necessary raw materials are taken in and used at once, CAM allows the plant to keep its stoma closed during the day to minimize water loss. The barrel cactus opens its stoma during the night to collect carbon dioxide from the environment and stores it as malic acid until photosynthesis begins in the morning. A side effect of CAM is a drop in the pH of the plant's fluids, sometimes reaching as low as 4.0. The low pH causes a bitter-tasting pulp that may help to discourage night feeding by wildlife.