Antibiotics work by affecting things that bacterial cells have but human cells don't. ... The antibiotic penicillin works by keeping a bacterium from building a cell wall. Bacteria and human cells also differ in the structure of their cell membranes and the machinery they use to build proteins or copy DNA.