Gram staining relies on cell wall differences; Gram-positive bacteria retain dye, while Gram-negative bacteria don't.