Question: The differences between the different spectral types of stars are primarily due to?
Answer: temperature of the photosphere
Natural Questions answer: ionization state (from the Wikipedia article "Stellar classification")