The Devonian Wengeqi mafic–ultramafic intrusion, situated on the northern margin of the North China Craton (NCC) — an Andean-style convergent margin during the Paleozoic — hosts many platinum-group minerals (PGMs), especially within the S-deficient, magnetite-rich clinopyroxenite zones. These PGMs occur in two distinct associations: Pt-rich PGMs (e.g., sperrylite) closely associated with primary magnetite and Pd-rich PGMs (e.g., sudburyite, kotuskite, arsenopalladinite) associated with secondary minerals (e.g., actinolite, pyrite). The mechanisms underlying the formation of PGMs in S-deficient rocks and the spatial decoupling of various PGM types remain elusive. The relationship of PGM formation and characteristics of magmas at convergent margins is also not well understood. In this contribution, we utilized apatite and clinopyroxene textures and chemistry alongside whole-rock SrNd isotopes to characterize i) the nature of the parental magma from which the Wengeqi intrusion crystallized, and ii) the magmatic–hydrothermal processes that operated to generate the Pt- and Pd-rich PGM. Based on the composition of clinopyroxene and clinopyroxene–melt partition coefficients, the parental magma of the Wengeqi intrusion is estimated to have an arc-like affinity on a primitive mantle-normalized trace-element diagram. This, together with the EMI-like SrNd isotope signature, implies that the Wengeqi magma was sourced from metasomatized SCLM beneath the NCC with an EMI-like composition. Three types of apatite (Ap1, Ap2, and Ap3) were identified within the intrusion. Ap1 and Ap2 are magmatic in origin, and appear as isolated grains, whereas Ap3 occurs as stringers or heterogeneous domains within Ap1 and Ap2, and likely resulted from hydrothermal modification of magmatic apatite. Notably, the abundant Ap2 exhibits higher VS contents and Eu/Eu* ratios than the less common Ap1, and contains S predominantly in the form of S6+, suggesting that the Wengeqi magma was relatively oxidized, with fO2 > FMQ + 1.2. Based on the chemistry of magmatic apatite, the Wengeqi magma had ∼5 wt% H2O, which, together with its high fO2, facilitated crystallization of magnetite, causing reduction of the magma by removal of Fe3+. This reduction process promoted PGM nucleation by decreasing PGE solubility in the magma, leading to the association of PGM with magnetite. Additionally, the oxidized, H2O-rich magma likely released oxidizing fluids, selectively mobilizing Pd rather than Pt, separating Pt-rich PGMs from Pd-rich PGMs. The budget of PGE in the parental magma could have been increased by i) metasomatism of the SCLM source (e.g., by carbonatitic fluids), which would have elevated the concentration of PGE in the mantle source, and ii) the high fO2 and H2O levels of the magma, which would have delayed sulfide saturation. Accordingly, mantle metasomatism and high fO2–H2O are deemed favorable for enrichment of PGE in magmas within convergent margins.