How do epidemics end?