Porphyry deposits are large, low-grade metal ore bodies that are formed from hydrothermal fluids derived from an underlying magma reservoir. They are important as major sources of critical metals for industry and society, such as copper and gold. However, the magmatic and redox processes required to form economic-grade porphyry deposits remain poorly understood. In this Review, we discuss advances in understanding crustal magmatic conditions that favour the formation of porphyry Cu deposits at subduction zones. Chalcophile metal fertility of mantle-derived arc magmas is primarily modulated by the amount and nature of residual sulfide phases in the mantle wedge during partial melting. Crustal thickness influences the longevity of lower crustal magma reservoirs and the sulfide saturation history. For example, in thick crust, prolonged magma activity with hydrous and oxidized evolving magmas increases ore potential, whereas thin crust favours high chalcophile element fertility, owing to late sulfide saturation. A shallow depth (<7 km) of fluid exsolution might play a role in increasing Au precipitation efficiency, as immiscible sulfide melts act as a transient storage of chalcophile metals and liberate them to ore fluids. Future studies should aim to identify the predominant sulfide phases in felsic systems to determine their influence on the behaviour of chalcophile elements during magma differentiation. The magmatic processes required to form economic-grade porphyry Cu deposits are still poorly understood. This Review discusses the magmatic, redox and hydrothermal processes required for porphyry ore formation, revealing that both crustal thickness and depth of ore body emplacement can influence metal endowment.