The immunological memory is part of the adaptive immune response that develops to a pathogen that has not previously infected the body. Once established, this immunological memory can be called into action if the same infection occurs again.
A naive B cell that both recognizes the pathogen and receives pro-survival signals from a helper T cell can produce antibodies to the pathogen and begin its differentiation. B cells can differentiate into professional antibody-secreting plasma cells, or preparatory memory B cells, ready to respond to a subsequent infection. Simultaneously, T cells recognizing the same pathogen increase in number and can differentiate into one of many effector cell types, such as cytotoxic, helper and regulatory T cells. In this way, the immune system expands its ability to respond to a second infection with the same pathogen.
If the same pathogen makes a second invasion, previously generated memory B cells differentiate into plasma cells and begin producing large volumes of antibody (usually IgG), which in turn mediates the humoral immune response. Should one of the previously differentiated effector T cells detect the pathogen, it will manifest its predetermined activity. For example, a cytotoxic T cell will kill any infected cell that bears the pathogen's antigen on its surface. This ensures a fast and efficient immune response.
This principle is the basis for creating an immunity towards a specific pathogen by vaccination.