Social contact with infectious colony members leads to pathogen transmission to previously healthy colony members. Often, this cross-contamination only leads to low-level infection of the colony members, which does not cause disease but induces a protective immunization.
Read more on how social contact to infectious nestmates reduces future disease susceptibility in ants, and how widespread individual and social immunity in insects:
Ugelvig & Cremer 2007 Curr Biol
Konrad et al 2012 PLoS Biol
Masri & Cremer 2014 Trends Immunol