The Diversity of Chemical Composition and the Effects on Stellar Evolution and Planetary Habitability