The immune system has evolved to protect the host against disease. Infectious disease can be caused by many different types of pathogens. These include viruses, bacteria, protozoa and parasitic worms. Some of these pathogens live and grow inside cells within the body (e.g. viruses, bacteria, protozoa) while others live and grow outside cells but within body fluids and tissues (e.g. bacteria, protozoa, parasitic worms). Many pathogens infect their hosts through mucosal surfaces such as the lung, gut and reproductive tract. They may cause disease at these initial sites of infection or they may spread and cause disease in other tissues and organs. The immune system therefore needs to be both flexible and highly specific if it is to combat different infections, while at the same time avoiding collateral damage to host tissues (immunopathology). It does this through a combination of sensory mechanisms that detect invading pathogens and effector mechanisms that combat the pathogens.
Links:
[1] http://www.moredun.ac.uk/staff/professor-gary-entrican
[2] http://www.moredun.ac.uk/staff/sean-wattegedera