Basic reproduction number
A very important number for determining whether an epidemic occurs is something called R0, pronounced "R naught." It refers to how many people any given person will infect, on average. It is called a basic reproduction number.
If R0 > 1, an epidemic will occur. If R0 < 1, an epidemic won't occur. All known diseases have R0 > 1, because otherwise they wouldn't be able to cause epidemics. However, we can use vaccines to make enough people immune in a population to stop epidemics from happening. We can also use other measures to make the effective reproduction rate (Re) lower than the basic reproduction rate (R0).
An example of vaccination working really well is the smallpox vaccine, which stopped smallpox virus from spreading so well that it longer exists, except in laboratories. An example of making the effective reproduction rate lower than the basic reproduction rate is using condoms to stop sexually transmitted diseases from spreading, or social distancing to stop respiratory diseases from spreading.