Most of the bacteria generates a cell wall which is composed partly of a macromolecule called peptidoglycan, it is made up of amino sugars and short peptides. Penicillin is one of those antibiotics which prevents the final cross-linkage step with the coordination of this macromolecule which results in the burst wall and kills the bacteria. It is safe for the host.