We all learn a simple description of photosynthesis in grade school but there are a lot more complicated process going on. Plants can utilize carbon at night and this description will explain a very advanced understanding of how CAM works.
AM plants or those plant species such as bromeliads, orchids, euphorbias and dracaenas use a secondary survival process called crassulacean acid metabolism (CAM) to survive very dry growing conditions like those found in the desert. This is an additional nutrient and water management process beyond basic carbon dioxide fixing which all plants perform. Malic acid builds up in plants overnight through the standard carbon fixing process and is cannibalized by the plant during the daylight hours. CAM plants capture the carbon dioxide given off in this cannibalization process to fuel the secondary life support process.