Vaccinations are given to provide immunity and protection against a certain disease or pathogen. The vaccine itself contains a weakened 'version' of the pathogen that retains its antigens but not its ability to cause illness. This allows the body's white blood cells to create an immunological memory via memory cells. As the pathogen is essentially deadened, this means there is no visible illness within the individual however does mean that if the individual comes across the pathogen again, there is a greater secondary response to the infection. This means that symptoms may not even develop as the immune system is quicker to 'react'.
Herd immunity occurs when a threshold is achieved where a certain percentage of people are vaccinated, protecting those who aren't. This means it is less likely that they'll be exposed to infection as most people won't develop it due to vaccination. Herd immunity is important as it protects vulnerable members of society who may not be able to be vaccinated, such as babies.