Theoretical and observational evidence for the role of collisions with electrons and neutral atoms in establishing the populations of atomic energy levels in stellar atmospheres are reviewed, with special reference to the problem of defining the range of validity of the approximation of local thermodynamic equilibrium. The discussion refers to stellar continuous spectra, absorption lines and emission lines believed to come from extended envelopes, surrounding certain hot stars.