The resistance to the spread of a contagious disease within a population due to a large portion of the population being immune.