Phosphorus diffusion is well known to getter effectively metal impurities during silicon solar cell processing. However, the main mechanisms behind phosphorus diffusion gettering are still unclear. Here, we analyze the impact of oxygen, phosphosilicate glass as well as active and clustered phosphorus on the gettering efficiency of iron. The results indicate that two different mechanisms dominate the gettering process. First, segregation of iron through active phosphorus seems to correlate well with the gettered iron profile. Secondly, immobile oxygen appears to act as an effective gettering sink for iron further enhancing the segregation effect. Based on these findings, we present a unifying gettering model that can be used to predict the measured iron concentrations in the bulk and in the heavily phosphorus doped layers and explains the previous discrepancies reported in the literature