simply.. when a foreign body invades the human body for the first time , the body responds by primary immune response .. this include recognition of the microbe and preparation of the fighting members suitable for this microbe. after its elimination , the body stores specific type of immune cells called "memory cells" . If the microbe return to invade the body soon or far , the body responds by secondary immune response where the memory cells are ready to fight rapidly and eliminate the microbe even before the symptoms of the disease appears.
please tell me if this helped you