Different width of spectral lines for different groups of stars

As seen in an HR-diagram, a certain stellar classification can correspond to more than one group/sequence of stars (G5 could for instance be either a giant, main sequence star or a white dwarf and so on). I have read in my textbook that even though these groups might have the same absorption spectrum, they can be distinguished by the thickness of their absorption-lines. For instance, giants have narrow lines and dwarfs broad ones. What is the physical explanation of this?

Many spectral lines are very sensitive to the surface gravity of the star - which enables a distinction between dwarfs and giants, because a giant's surface gravity is factors of $\sim 100$ lower than that of a dwarf of the same temperature.