The Earth immune system is a controversial proposal, claimed to be a consequence of the Gaia hypothesis.
The Gaia hypothesis holds that the entire earth may be considered a single organism (Gaia).
As a self-maintaining organism, Earth would possess an immune system of some sort in order to maintain its health.
Some proponents of this speculative concept, for example, hold that humankind can be considered an "infection" of Gaia, and that AIDS is a attempt by this immune system to reject the infection.
"Cancer" might be a more accurate term, as humans evolved within Gaia, and are not external invaders.
An opposite view is that humankind is Gaia's immune system itself, perhaps evolved to avert future catastrophes such as the Permian and Cretaceous mass extinctions of species.