As I understand it soap, generically (and somewhat incorrectly) defined as what you wash with is both an agent that allows microorganisms to be better washed away and, to some small extent, an anti-microbial agent. Granted its main action is to dissolve the oily film that naturally coats skin and to aid the bodily removal of microorganisms but the same action does, to some extent, damage the cell walls of bacteria.
The most widely used anti-microbial cleaning agents in hospitals are termed "quats" , short for quaternary detergents. Essentially a synergistic mix of four related detergents. These attack microorganisms by chemically destroying the integrity of their cell membranes. It is hard to stay alive when your guts keep leaking out. Even more so when your microscopic.