Strong photospheric chemical peculiarities are observed in a significant fraction of main sequence stars from B to early F spectral types. The development of these chemical peculiarities is understood in the framework of atomic diffusion. However, the details leading from this theoretical framework to the diversity of observed surface abundance characteristics, particularly the impact of competing processes, are not fully understood. In the chemically peculiar Am and HgMn stars, binarity appears to be a basic ingredient providing the conditions necessary for these peculiarities to develop. In contrast, the magnetic chemically peculiar Ap and Bp stars appear to be anomalously rare in short period binary systems. This likely provides a clue to the origin of the magnetic fields in Ap and Bp stars.