How does the process of CAM photosynthesis work?

In brief, CAM photosynthesis occurs in plants which may have to conserve water. These plants close the stomata in the daylight, and open them at night. Thus conserving most (>90%) of the water otherwise lost due to transpiration.

During the night they absorb CO2 and store it in an acid, hence the CAM - Crassulacean Acid Metabolism.

The Crassulacea refers to a plant family in which the mechanism was first studied - it is NOT the metabolism of Crassulacean Acid. The acid was named after the plant.

Many of the plant families in which this CAM process occur are those that may have to withstand drought. The great variety of Families of plants (both Angisperms and Gymnosperms) covers many hundreds of Genera, indicates that this mechanism has been discovered many times - a natural convergent evolution.

Pineapple and Cacti are very common plants using CAM, but plants such as mosses and Quillworts (Isoetales) also use it. These lowly plants must often have a water problem. Perching orchids are another obvious group of adaptees.