structural:reformatting, linguistic:paraphrasing
Phylogeny

A 2005 study suggested the genus Pereskia as then circumscribed (Pereskia sensu lato) was basal within the Cactaceae, but confirmed earlier suggestions it was not monophyletic, i.e., did not include all the descendants of a common ancestor. The Bayesian consensus cladogram from this study is shown below with subsequent generic changes added.

A 2011 study using fewer genes but more species also found that Pereskia s.l. was divided into the same clades, but was unable to resolve the members of the "core cacti" clade. It was accepted that the relationships shown above are "the most robust to date."

Leuenbergeria species (Pereskia s.l. Clade A) always lack two key features of the stem present in most of the remaining "caulocacti": like most non-cacti, their stems begin to form bark early in the plants' life and also lack stomata —structures that control admission of air into a plant and hence control photosynthesis. By contrast, caulocacti, including species of Rhodocactus and the remaining species of Pereskia s.s., typically delay forming bark and have stomata on their stems, thus giving the stem the potential to become a major organ for photosynthesis. (The two highly specialized species of Maihuenia are something of an exception.)

The first cacti are thought to have been only slightly succulent shrubs or small trees whose leaves carried out photosynthesis. They lived in tropical areas that experienced periodic drought. If Leuenbergeria is a good model of these early cacti, then, although they would have appeared superficially similar to other trees growing nearby, they had already evolved strategies to conserve water (some of which are present in members of other families in the order Caryophyllales). These strategies included being able to respond rapidly to periods of rain, and keeping transpiration low by using water very efficiently during photosynthesis. The latter was achieved by tightly controlling the opening of stomata. Like Pereskia species today, early ancestors may have been able to switch from the normal C mechanism, where carbon dioxide is used continuously in photosynthesis, to CAM cycling, in which when the stomata are closed, carbon dioxide produced by respiration is stored for later use in photosynthesis.

The clade containing Rhodocactus and Pereskia s.s. marks the beginnings of an evolutionary switch to using stems as photosynthetic organs. Stems have stomata and the formation of bark takes place later than in normal trees. The "core cacti" show a steady increase in both stem succulence and photosynthesis accompanied by multiple losses of leaves, more-or-less complete in the Cactoideae. One evolutionary question at present unanswered is whether the switch to full CAM photosynthesis in stems occurred only once in the core cacti, in which case it has been lost in Maihuenia, or separately in Opuntioideae and Cactoideae, in which case it never evolved in Maihuenia.

Understanding evolution within the core cacti clade is difficult as of February 2012, since phylogenetic relationships are still uncertain and not well related to current classifications. Thus, a 2011 study found "an extraordinarily high proportion of genera" were not monophyletic, so were not all descendants of a single common ancestor. For example, of the 36 genera in the subfamily Cactoideae sampled in the research, 22 (61%) were found not monophyletic. Nine tribes are recognized within Cactoideae in the International Cactaceae Systematics Group (ICSG) classification; one, Calymmantheae, comprises a single genus, Calymmanthium. Only two of the remaining eight – Cacteae and Rhipsalideae – were shown to be monophyletic in a 2011 study by Hernández-Hernández et al. For a more detailed discussion of the phylogeny of the cacti, see Classification of the Cactaceae.