Peptidoglycan is a giant molecule that forms the cell wall that surrounds bacterial cells. It is composed of alternating N-acetylglucosamine (NAG) and N-acetylmuramic acid (NAM) residues connected by -(1,4)-glycosidic bonds and cross-linked with short polypeptide chains. Owing to the increasing antibiotic resistance against drugs targeting peptidoglycan synthesis, studies of enzymes involved in the degradation of peptidoglycan, such as N-acetylglucosaminidases, may expose new, valuable drug targets. The scientific challenge addressed here is how lysozymes, muramidases which are likely to be the most studied enzymes ever, and bacterial N-acetylglucosaminidases discriminate between two glycosidic bonds that are different in sequence yet chemically equivalent in the same NAG-NAM polymers. In spite of more than fifty years of structural studies of lysozyme, it is still not known how the enzyme selects the bond to be cleaved. Using macromolecular crystallography, chemical synthesis and molecular modelling, this study explains how these two groups of enzymes based on an equivalent structural core exhibit a difference in selectivity. The crystal structures of Staphylococcus aureus N-acetylglucosaminidase autolysin E (AtlE) alone and in complex with fragments of peptidoglycan revealed that N-acetylglucosaminidases and muramidases approach the substrate at alternate glycosidic bond positions from opposite sides. The recognition pocket for NAM residues in the active site of N-acetylglucosaminidases may make them a suitable drug target.