The Gram stain, developed by Hans Christian Gram in 1884, differentiates between cell types based on the differences in their cell envelopes.