Abstract Porphyry-related mineral deposits are giant geochemical anomalies in the Earth’s crust with orders-of-magnitude differences in the content and proportion of the three main ore metals Cu, Au, and Mo. Deposit formation a few kilometers below surface is the product of a chain of geologic processes operating at different scales in space and time. This paper explores each process in this chain with regard to optimizing the chances of forming these rare anomalies. On the lithosphere scale, deposits with distinct metal ratios occur in provinces that formed during brief times of change in plate motions. Similar metal ratios of several deposits in such provinces compared with global rock reservoirs suggest preceding enrichment of Au or Mo in lithospheric regions giving rise to distinct ore provinces. The largest Cu-dominated deposits and provinces are traditionally explained by selective removal of Au during generation or subsequent evolution of mantle magmas, but the possibility of selective Cu pre-enrichment of lithosphere regions by long-term subduction cannot be dismissed, even though its mechanism remains speculative. Evolution of hydrous basaltic melts to fertile magmas forming porphyry Cu deposits requires fractionation toward more H2O-rich magmas in the lower crust, as shown by their adakite-like trace element composition. The prevailing interpretation that this fractionation leads to significant loss of chalcophile ore metals by saturation and removal of magmatic sulfide might be inverted to a metal enrichment step, if the saturating sulfides are physically entrained with the melt fraction of rapidly ascending magmas. Ascent of fertile magma delivers a large mass of H2O-rich ore fluid to the upper crust, along points of weakness in an overall compressive stress regime, within a limited duration as required by mass and heat balance constraints. Two mechanisms of rapid magma ascent are in debate: (1) wholesale emplacement of highly fractionated and volatile-rich granitic melt into a massive transcrustal channelway, from which fluids are exsolved by decompression starting in the lower crust, or (2) partly fractionated magmas filling a large upper crustal magma chamber, from which fluids are expelled by cooling and crystallization. Transfer of ore-forming components to a hydrothermal ore fluid is optimized if the first saturating fluid is dense and Cl rich. This can be achieved by fluid saturation at high pressure, or after a moderately H2O rich intermediate-composition melt further crystallizes in an upper crustal reservoir before reaching fluid saturation. In either case, metals and S (needed for later hydrothermal sulfide precipitation) are transferred to the fluid together, no matter whether ore components are extracted from the silicate melt or liberated to the ore fluid by decomposition of magmatic sulfides. Production and physical focusing of fluids in a crystallizing upper crustal magma chamber are controlled by the rate of heat loss to surrounding rocks. Fluid focusing, requiring large-scale lateral flow, spontaneously occurs in mushy magma because high water content and intermediate melt/crystal ratio support a network of interconnected tubes at the scale of mineral grains. Calculated cooling times of such fluid-producing magma reservoirs agree with the duration of hydrothermal ore formation measured by high-precision zircon geochronology, and both relate to the size of ore deposits. Ore mineral precipitation requires controlled flow of S- and metal-rich fluids through a vein network, as shown by fluid inclusion studies. The degree of hydrothermal metal enrichment is optimized by the balance between fluid advection and the efficiency of cooling of the magmatic fluid plume by heat loss to convecting meteoric water. The depth of fluid production below surface controls the pressure-temperature (P-T) evolution along the upflow path of magmatic fluids. Different evolution paths controlling density, salinity, and phase state of fluids contribute to selective metal precipitation: porphyry Au deposits can form at shallow subvolcanic levels from extremely saline brine or salt melt; high-grade Au-Cu coprecipitation from coexisting and possibly rehomogenizing brine and vapor is most efficient at a depth of a few kilometers; whereas fluids cooling at greater depth tend to precipitate Cu ± Mo but transport Au selectively to shallower epithermal levels. Exhumation and secondary oxidation and enrichment by groundwater finally determine the economics of a deposit, as well as the global potential of undiscovered metal resources available for future mining.