Too much heavy metal stops stars producing more

Stars are giant factories that produce most of the elements in the universe—including the elements in us, and in Earth's metal deposits. But how do stars produce changes over time?