At first, they identified a number of stars which showed a very STRONG pattern
of lines, called the Balmer Lines. (due to Hydrogen). They were Called 'A' Stars.
Those stars with slightly weaker Balmer lines of Hydrogen, were called 'B' Stars and so on. At one point, the letters labeling all these different looking stellar
spectra went all the way to 'S'!!
It was realized by Annie J. Cannon, an assistant at the Harvard Observatory
beginning in 1896, that there were really only about 7 unique kinds of stars, and
all other LETTERS were dropped.
Ms. Cannon classified more than a quarter million stars
which were published as The Draper Catalogue in nine volumes, from 1918 to 1924.
The Hydrogen lines are weaker in B stars because they are getting too hot for
Hydrogen to exist in the right electronic state to create the Balmer lines.
For cooler stars, F, then G, the stellar photosphere is too cool to create
strong Balmer lines. Certain kinds of elements like (are strong in
absorption) certain stellar temperature ranges.
By late in the last century, people had began looking closely at the spectra
of stars. It was realized that the spectra of stars (in particular, their
patterns of absorption lines) had systematic features!!