Building immunity against a specific pathogen, involving antigen recognition, T and B cell differentiation, and antibodies.