This euphorbia bears such a striking similarity to a genus in the cactus family, Gymnocalycium, that it was given the epithet gymnocalycioides (resembling Gymnocalycium). It is a fine example of convergent evolution, a process in which the same adaptive traits evolve in distantly related species or groups as a response to similar environments (in this case, hot and dry deserts). Euphorbia gymnocalycioides is native to Ethiopia while the genus Gymnocalycium is distributed in the grasslands and deserts of southern South America.
The genus Euphorbia has over two thousand species with a striking diversity of form, from annuals to perennials (succulent or otherwise) to shrubs and trees. Most, if not all, contain a milky latex sap that can cause severe inflammation (see the comments re: Euphorbia myrsinites). Another hallmark of the group is highly reduced flowers; see the illustration “Euphorbia cyathium explained” on this page about flowers from an Iowa State University plant systematics course.