When you vaccinate someone, or when you get infected, the microbe is presenting itself to the immune system in a way that the immune system recognizes the important elements of the microbe and makes an immune response, both an antibody response and a cellular response, to ultimately contain the microbe.