Vaccination introduces a weak or dead version of a pathogen to the body to bring about immunity. Public vaccination can bring herd immunity for some diseases.
The immune system works by detecting specific pathogens and create defences against them. It does this by creating antibodies against the antigen on the pathogen.
Memory cells are also created which results in a faster immune response the next time the pathogen is detected in the body.
However some pathogens have the ability to alter their antigens. As a result, memory cells do not detect the altered antigens and are no longer effective against the pathogen. This is called antigenic variation.
Influenza (flu) viruses are a good example of antigenic variation.
The antigens of a flu virus can change so frequently that flu vaccines quickly become ineffective. This makes influenze an ongoing major public health problem. New vaccines to target altered antigens in new "strains" of flu are designed every year and used to inoculate people in "at risk groups" against new strains of the virus.