Wounds fester for the same reason broth goes bad: germs get into them from outside. Kill the germs, on the wound, the instruments, and the surgeon’s hands, and wounds heal clean.
Germs cause infectious diseases, and they pass from one person to the next by touch, in water or food, and through the air, on droplets so small that they float. Tuberculosis spreads that way.