These then explode as SNe. All stars have mass loss. Have thermal winds resulting from gas that 'boils' away in a hot corona. Usually have higher mass loss. Mass loss is driven by the high luminosities.
Winds are important for two reasons.
First a star's mass determines its evolution and eventual demise. The Sun will lose about half of its mass before becoming a White Dwarf. Second, the mass loss recycles gas into the Interstellar Medium. A star forms, it loses mass, that gas becomes part of a cloud, a star forms, and so on.