In fact, in many cases, it simply triggers the "herd instinct" -people see that their friends are vaccinated and go to be vaccinated themselves, without really thinking about the fact that they are fulfilling some duty to society.
Well, personally, in my case, it was that several of my friends and their relatives got sick with this disease, which probably pushed me to get vaccinated.