During the daytime, cacti, like other green plants, undergo photosynthesis, which involves absorbing carbon dioxide (CO2) and releasing oxygen. However, during the nighttime, cacti, like most plants, switch their metabolic processes, releasing a small amount of carbon dioxide through respiration.