The type of immunity that provides lifetime immunity for the body against a specific pathogen is called acquired immunity. It is also referred to as adaptive or specific immunity.
Acquired immunity is not present at birth. it is learned. As a person's immune system encounters foreign substances (antigens) the components of acquired immunity learn the best way to attack each antigen and begin to develop a memory for that antigen. Acquired immunity is also called specific immunity because it tailors its attack to a specific antigen previously encountered. Its uniqueness lies in its ability to learn, adapt and remember.
Acquired immunity takes time to develop after first exposure to a new antigen. However afterward, the antigen is remembered, and subsequent responses to that antigen are quicker and more effective than those that occurred after first exposure. Memory of a particular antigen is kept by the B and T lymphocytes.