Immunity acquired by encountering a pathogen either by vaccination or having the disease. The body produces specific antibodies against a pathogen.