A bacterial infection occurs when bacteria enter the body, increase in number, and cause a reaction in the body. Bacteria can enter the body through an opening in your skin, such as a cut or a surgical wound, or through your airway and cause infections like bacterial pneumonia.