Parasites and pathogens are a ubiquitous threat facing all organisms. Life history theory predicts that if investment in parasite resistance mechanisms is costly (as suggested by numerous studies), then organisms should tailor their investment in them to match their perceived risk of infection. Because most parasites are transmitted in a positively density-dependent manner, the threat from parasites tends to increase as population density increases. As a result, it is predicted that organisms should use population density as a cue to the risk of becoming infected and should increase investment in disease resistance mechanisms as the degree of crowding increases—this is known as density-dependent prophylaxis (DDP). This phenomenon has been experimentally tested in a number of insect species, and in most cases support for the DDP hypothesis has been forthcoming. DDP is likely to be particularly prevalent in species exhibiting density-dependent phase polyphenism (i.e. the phenotype adopted by the insect is plastic and dependent on the population density it experiences during its early development). We discuss the hormonal and genetic mechanisms underlying phase polyphenism and DDP, and speculate on the circumstances leading to their evolution. We end by discussing how future research into DDP might develop.