In case you're actually curious OP:
For a given disease, you have a number
R.
R is the number of people that a single infected person will infect. If
R > 1, then each infected individual will infect more than one person and the disease will spread within a population. If
R < 1 then it takes many infected individuals to infect another person, and the disease will die out.
R can be expressed mathematically.
This is math-speak, and basically says that R is proportional to (∝
three variables which we can modify: d, c, and s.
'd' = Amount of time a person is infectious, measured in [days]
'c' = Number of people encountered each day, measured in [contacts/day]
's' = Fraction of the contacts who are Susceptible to the disease (a number between 0 and 1)
A major goal of epidemic control is to reduce R to a value less than one by manipulating these three variables. Again, if
R < 1, then the disease will eventually die out.
I will note here that there are other factors which contribute to R. These correspond to various properties of the pathogen. For instance, if a disease is airborne, like measles, R will be extremely high (R > 10). If a disease is transmitted by fluid contact, like Ebola, R will be much lower (R == about 2). That said, these methods work the same regardless of what pathogen you're talking about:
You can make 'd' smaller by treating the disease early in its course.
You can make 'n' smaller by setting up a quarantine, or telling infected people to stay home from work and school. 'n' also gets smaller if enough people start dying out.
's' gets smaller in one of two ways. (1) people become immune to the disease (e.g., they get the virus and they recover; this is why epidemics burn out) or (2) they are vaccinated.
That is herd immunity, explained in the most basic way. A vaccine does not need to be 100% effective in order to work. It need only be effective enough to reduce R to a value less than 1.0.