Chemical effects of satellites on X-ray emission spectra—II. A general theory of the origin of chemical effects and its application to Cl Kα spectra