The formation of certain types of doped polysilicon passivating contacts for silicon solar cells is recently reported to generate very strong impurity gettering effects, revealing an important additional benefit of this passivating contact structure. This work investigates the underlying gettering mechanisms by directly monitoring the impurity redistribution during the contact formation and subsequent processes, via a combination of secondary ion mass spectrometry (SIMS), transmission electron microscopy (TEM), and minority carrier lifetime techniques. Microscopic features of the phosphorus and boron diffusion-doped polysilicon passivating contacts are also presented. Iron is used as a marker impurity in silicon to enable direct quantification of its concentration change in the bulk of the silicon wafers and in the surface layers that compose the contact structure. The results conclusively show that, for phosphorus-doped polysilicon passivating contacts, impurities are relocated from the silicon wafer bulk to the heavily phosphorus-doped polysilicon layer; while for the boron diffusion-doped polysilicon, the boron-rich layer (a silicon−boron compound) accounts for the majority of the gettering action.