Apatite, as a common accessory mineral found in magmatic–hydrothermal deposits, effectively yields geochemical insights that facilitate our understanding of the mineralization process. In this research, multiple generations of magmatic and hydrothermal apatite were observed in the Hongshan porphyry–skarn Cu–Mo deposit in the Yidun Terrane in SW China. The geochemical compositions of the apatite were studied using in situ laser ablation–inductively coupled plasma mass spectrometry and an electron probe microanalysis to understand the magmatic–hydrothermal processes leading to ore formation. The apatite (Ap1a) occurs as subhedral to euhedral inclusions hosted in the phenocrysts of the granite porphyry. The Ap1b occurs later than Ap1a in a fine-grained matrix that intersects the earlier phenocrysts. Increases in F/Cl, F/OH, and F/S and decreases in ΣREE and (La/Yb)N from Ap1a to Ap1b suggest the exsolution of a volatile-rich phase from the magma. The skarn hosts three types of hydrothermal apatite (Ap2a, Ap2b, and Ap3), marking the prograde, retrograde, and quartz–sulfide stages of mineralization, respectively. The elemental behaviors of hydrothermal apatite, including the changes in Cl, Eu, As, and REE, were utilized to reflect evolutions in salinity, pH, oxygen fugacity, and fluid compositions. The composition of Ap2a, which occurs as inclusions within garnet, indicates the presence of an early acidic magmatic fluid with high salinity and oxygen fugacity at the prograde skarn stage. The composition of Ap2b, formed by the coupled dissolution-reprecipitation of Ap2a, indicates the presence of a retrograde fluid that is characterized by lower salinity, higher pH, and a significant decrease in oxygen fugacity compared to the prograde fluid. The Ap3 coexists with quartz and sulfide minerals. Based on studies of Ap3, the fluids in the quartz–sulfide stage exhibit relatively reducing conditions, thereby accelerating the precipitation of copper and iron sulfides. This research highlights the potential of apatite geochemistry for tracing magmatic–hydrothermal evolution processes and identifying mineral exploration targets.