Histology can detect infections by identifying morphological changes in tissues that are indicative of an infection. Infected tissues often exhibit specific patterns, such as inflammation, necrosis, or presence of microorganisms, which can be visualized using various staining techniques.