A Gram stain is a laboratory staining technique used to classify bacteria into two major groups: Gram-positive and Gram-negative. This differentiation is based on the physical and chemical properties of the bacterial cell walls. The technique involves staining bacterial cells with crystal violet dye, followed by a counterstain, usually safranin.