How do vaccines give immunity to infectious diseases?

AThey kill pathogenic microbes.
BThey produce an immune response.
CThey contain antibodies against pathogens.
DThey inhibit the antigen-antibody reaction.