Four factors contribute to the roles played by chance and necessity in determining mineral distribution and diversity at or near the surfaces of terrestrial planets: (1) crystal chemical characteristics; (2) mineral stability ranges; (3) the probability of occurrence for rare minerals; and (4) stellar and planetary stoichiometries in extrasolar systems. The most abundant elements generally have the largest numbers of mineral species, as modeled by relationships for Earth9s upper continental crust (E) and the Moon (M), respectively: Log ( N E ) = 0.22 Log ( C E ) + 1.70 ( R 2 = 0.34 ) ( 4861 minerals , 72 elements ) Log ( N M ) = 0.19 Log ( C M ) + 0.23 ( R 2 = 0.68 ) ( 63 minerals , 24 elements ) , where C is an element9s abundance in ppm and N is the number of mineral species in which that element is essential. Several elements that plot significantly below the trend for Earth9s upper continental crust ( e.g. , Ga, Hf, and Rb) mimic other more abundant elements and thus are less likely to form their own species. Other elements ( e.g ., Ag, As, Cu, Pb, S, and U) plot significantly above the trend, which we attribute to their unique crystal chemical affinities, multiple coordination and oxidation states, their extreme concentration in some ore-forming fluids, and/or frequent occurrence with a variety of other rare elements—all factors that increase the diversity of mineral species incorporating these elements. The corresponding diagram for the Moon shows a tighter fit, most likely because none of these elements, except Cu and S, are essential constituents in lunar minerals. Given the similar slopes for Earth and the Moon, we suggest that the increase in mineral diversity with element abundance is a deterministic aspect of planetary mineral diversity. Though based on a limited number of collecting sites, the Moon9s observed mineralogical diversity could be close to the minimum for a rocky planet or moon comparable in size—a baseline against which diversity of other terrestrial planets and moons having radii in the same range as Earth and its Moon can be measured. Mineral-forming processes on the Moon are limited to igneous activity, meteor impacts, and the solar wind—processes that could affect any planet or moon. By contrast, other terrestrial planets and moons have been subjected to more varied physical, chemical, and (in the case of Earth) biological processes that can increase mineral diversity in both deterministic and stochastic ways. Total mineral diversity for different elements is not appreciably influenced by the relative stabilities of individual phases, e.g. , the broad pressure-temperature-composition stability ranges of cinnabar (HgS) and zircon (ZrSiO 4 ) do not significantly diminish the diversity of Hg or Zr minerals. Moreover, the significant expansion of near-surface redox conditions on Earth through the evolution of microbial oxygenic photosynthesis tripled the available composition space of Earth9s near-surface environment, and resulted in a corresponding tripling of mineral diversity subsequent to atmospheric oxidation. Of 4933 approved mineral species, 34% are known from only one or two localities, and more than half are known from five or fewer localities. Statistical analysis of this frequency distribution suggests that thousands of other plausible rare mineral species await discovery or could have occurred at some point in Earth9s history, only to be subsequently lost by burial, erosion, or subduction— i.e. , much of Earth9s mineral diversity associated with rare species results from stochastic processes. Measurements of stellar stoichiometry reveal that stars can differ significantly from the Sun in relative abundances of rock-forming elements, which implies that bulk compositions of some extrasolar Earth-like planets likely differ significantly from those of Earth, particularly if the fractionation processes in evolving stellar nebulas and planetary differentiation are factored in. Comparison of Earth9s upper continental crust and the Moon shows that differences in element ratios are reflected in ratios of mineral species containing these elements. In summary, although deterministic factors control the distribution of the most common rock-forming minerals in Earth9s upper continental crust and on the Moon, stochastic processes play a significant role in the diversity of less common minerals. Were Earth9s history to be replayed, and thousands of mineral species discovered and characterized anew, it is probable that many of those minerals would differ from species known today.