Plants have a wide range of invaders to deal with — viruses, bacteria, fungi, insects and nematodes to name a few — but they deal with these attackers very differently to the way animals and humans do.
Humans and animals have a circulating immune system, where white blood cells and T-cells are circulated throughout the body in the blood and protect the cells under attack.
Plants don't have that circulatory system, so each cell in the plant has to be able to respond independently. Individual plant cells express receptors that recognise pathogen molecules and then trigger defense responses, which can include cell wall thickening, production of anti-microbial compounds and host cell death.
Manually, pest resistant plants are developed by genetic engineering to prevent pest attacks.