Cacti open their stomata, or tiny pores on their leaves, during the day to take in carbon dioxide and release oxygen.
However, cacti continue to photosynthesize at night when the stomata are shut to preserve water by utilizing the sunlight's stored energy.