Stains work based on the chemical properties of both the stain and the tissue. For example, hematoxylin is a basic dye that binds to acidic components of the cell, such as nucleic acids, staining them blue. Eosin, on the other hand, is an acidic dye that binds to basic components like cytoplasmic proteins, staining them pink. The combination of these stains provides a clear distinction between nuclei and the cytoplasm.