The efficiency of as-deposited CdTe solar cells is typically <5 %. An activation process involving the post-treatment of the CdTe surface with cadmium chloride at approximately 400 deg C improves the absorber microstructure by removing stacking faults, fills the grain boundaries with chlorine and leads to efficiencies of up to ~22 %. Stacking fault removal and improvement in device efficiency are thus correlated but the question of whether this correlation is direct or indirect has to date not been established. Although some types of stacking fault could be hole traps, those most commonly observed are tetrahedral in nature which recent work has shown to be electrically benign. For the first time, in this paper, we not only explain the passivation responsible for this efficiency increase but crucially elucidate the associated stacking fault removal mechanism. Experimental work shows that as chlorine is added to the system, the stacking faults gradually disappear from the absorber layer upwards to the surface with some grains being fault-free in the intermediate state before full saturation. At saturation chlorine decorates all the grain boundaries and so the effect of chlorine on a model system of a tetrahedral stacking fault bounded by two grain boundaries is investigated using density functional theory (DFT). We find that if the stacking faults between the grain boundaries were to be removed without Cl, this would result in an energy increase for the system. Increasing the chlorine concentration in the grain boundaries decreases the energy difference between the faulted and unfaulted system until a cross-over occurs close to the point at which chlorine saturates the grain boundaries. The atomic mechanisms and energy profile for the stacking fault removal is presented. The removal process is via a cascade effect whereby the system energy gradually increases as the fault is sequentially removed until the layers snap into place. The energy barrier for this to occur is easily overcome with the 400 deg C temperature treatment. Density of States (DOS) plots of the chlorine saturated structures show that defect passivation occurs in the highly reconstructed grain boundaries due to both interstitial and substitutional chorine. Chlorine saturation is shown to disconnect the two sides of the grain boundary avoiding electronic defects which arise from the interaction of dangling bonds across this region. It is thus concluded that the cell efficiency increase observed is due to the electronic effects of chlorine in the grain boundaries and that the observed stacking fault removal is a bi-product of the chlorine grain boundary saturation.