what can we learn from an analysis of a stellar spectrum?

The composition of the star, and from that, usually determine its age.