The emission and absorption lines correspond to exactly the same changes in atomic energy levels. One would need to completely ionize the atoms of the thin gas, in order to eliminate the absorption line spectrum. The surface temperature of a star determines the level of ionization of the gas as well as the manner in which the atomic energy levels in the constituent atoms and ions are populated. Higher temperatures cause higher levels of ionization and result in the atoms and ions of the gas being in higher energy levels and vice versus for lower surface temperatures. Since absorption line come from transitions between atomic energy levels in atoms or ions, the particular pattern of lines seen in a stellar spectrum depends on the precise mix of ions and atoms in the gas as well as the specific energy levels that are populated.
Most stars fall on the main sequence, which suggests that stars spend most of their lives there.
More fundamentally, the higher luminosity stars are bigger in size and generally more massive than the lower luminosity ones.