Barriers provide an initial defence to prevent pathogens from entering the body. This is an important mechanism, onto which other processes are layered.
For example, the skin is host to many other species of bacteria (commensals), providing a microbiological defence. This creates competition for limited nutrients, minerals, …, reducing the likelihood of a more dangerous pathogen growing.
Chemicals, such as lysozyme, can be secreted onto these barriers (as occurs in the mucosal membranes). These enzymes inhibit the growth of bacteria, preventing their entry into the body.
Staphylococcus aureus can breach the skin in some cases, such as where the skin is punctured or the microbiota is disturbed. Use of oral antibiotics can disturb the microbiota of the GI tract, allowing opportunistic pathogens to become pathogenic. These pathogens can cause inflammation in the GI tract, increasing permeability of the barrier and potentially allowing infection of the blood and underlying tissue. E.g.- Chron’s disease.