Many of the strongest spectral lines (e.g. Balmer absorption lines and resonance lines of metals) are very sensitive to the surface gravity of the star. This enables a distinction between main sequence dwarfs and giants because a giant star's surface gravity is factors of $\sim 100$ lower than that of a dwarf star of the same temperature and has narrower absorption lines. Conversely, white dwarfs have much broader lines, because their surface gravities are $\sim 10^4$ times larger than a main sequence star.
The reason that surface gravity plays a role is via hydrostatic equilibrium; the densities and pressures in a giant star's atmosphere are much lower at a given temperature. If an atom or ion suffers frequent collisions in a high density environment then the absorption cross section can be smeared out by "pressure broadening" - a catch-all term, which can refer to a number of mechanisms (Stark effect, van der Waals broadening, collisional broadening), whereby interactions can either perturb the energy levels of atoms and ions or truncate the radiative emission processes (e.g. Foley 1946; Griem 1976).
In main sequence dwarfs, pressure broadening is sufficient to give an appreciable cross section in the line wings and means that the visible lines are formed at a greater range of temperatures than would otherwise be the case. In giant stars, this broadening mechanism is ineffective, even in strong lines, and they are completely dominated by thermal doppler broadening close to the temperature where the line core is formed and this produces a narrower profile overall.