Immunity is the complex biological system that protects an organism against diseases by identifying and killing pathogens and tumor cells. It also involves the ability to distinguish between self and non-self, and to maintain tolerance to harmless substances to avoid unnecessary inflammation and allergies.