… the causes of most of the stellar spectrum variations became apparent: They were variations in surface temperatures and luminosities (so, also gravities and pressures/densities) of stars. The spectral classes became surrogates for these physical quantities.
Trust classifications to give a general idea for what kind of star you are dealing with, but if you want accurate physical knowledge about the star, you’d have to look into data acquired via more sophisticated spectral studies.