The immune system is a network of cells, tissues and organs that work together to defend the body against harmful pathogens such as bacteria, viruses, fungi, parasites and abnormal cells such as cancer cells. Its primary function is to distinguish between self and non-self to mount the right immune response.