The immune system is capable of "learning" how to recognize specific pathogens, with help from memory B cells and passive immunity.
Pathogens are microorganisms that cause disease. A part of that pathogen can be considered an antigen, which is any substance that causes an immune response. After initial exposure to an antigen, a substance that is recognized by surface antibodies (B cells) or other immune cells to prompt an immune response, memory B cells become dormant, but they retain their ability to rapidly generate large quantities of an antibody in response to an antigen. This form of acquired immunity is considered active natural immunity. It is active because the antibodies were generated by B cells within the organism, and it is natural because it happened without any medical interference. There are other types of acquired immunity, however. Memory B cells can be activated when antigens are presented to the body in the form of a vaccine. This immunity is active because the antibodies are generated by B cells within the organism. It is artificial, however, because the presentation of the antigen required medical intervention.
Passive immunity occurs when one organism receives antibodies produced by another organism, rather than producing the antibodies itself. This can happen naturally during pregnancy, where antibodies may be passed through the placenta from mother to fetus. Antibodies also pass from mother to child through colostrum and breast milk. Colostrum is a milky fluid that is produced in the first few days after giving birth. Passive artificial immunity is also possible through the injection of antibodies developed in a different organism. Unlike active immunity, in which memory B cells are activated, passive immunity only provides short-term protection.