Two scientists, Ejnar Hertzsprung and Henry N. Russell, discovered the connection between a star’s luminosity, absolute magnitude, and temperature.
They created a graph, called the Hertzsprung-Russell diagram, on which all stars can be plotted according to these three characteristics.
When stars are put onto the graph, 90 percent of them fall along one diagonal path, showing that there is a definite relationship between how hot a star is and how bright and luminous it is.
Astronomers refer to stars along this path as main sequence stars.
Cooler, less bright/luminous main sequence stars are called red dwarfs.
Hot, very bright/luminous main sequence stars are referred to as blue giants.
Stars not on the main sequence that are both cool and very bright/luminous are super giants or red giants.
A few other stars, not on the main sequence, are hot, but not bright/luminous. They are called white dwarfs.
At the beginning and end of its life, a typical star will be dark, for example, +15, but as a mature and dying star, it may reach great magnitude, for example, -10.
Likewise, a star will move back and forth through many spectral classes, M class being the coldest and 0 class the hottest.
A star’s mass largely determines its magnitude and temperature.