Recently an article was posted on the 'galactic fountain' model. According to this picture, one can imagine what happens when stars explode within galaxies like the Milky Way. Such events blow hot gas and dust high out of the galaxy. This gas and dust will subsequently cool, then 'rain' back down again (and back up too on the underside of a galaxy and was discussed in this recent post).
The ability of at least the larger galaxies like the Milky Way to retain much of their material is important for mixing the ingredients for life throughout the galaxy disk.
Early on, many billions of years ago, our own neighborhood of outer space within the Milky Way contained mostly just hydrogen and helium. It lacked any of the other elements of the periodic table necessary for organic chemistry and for life as we know it.
This meant that there was little to no carbon, nitrogen, oxygen, silicon, iron and all the other elements that make up Earth and us. Such chemical elements, and in fact all elements other than hydrogen, helium and scant amounts of lithium, are manufactured only by stars and as a result of stellar explosions or supernovae. Without stars it would be a rather boring universe.
Relevant to us humans, it is likely the case that many galactic fountains rich in chemical elements occurred in our Galaxy in the past. Each fountain event rained down chemical elements into our own neighborhood of outer space, thereby enriching the cloud that eventually became the Sun and Earth with its current set of chemical elements.
Instead of exploding out of the Milky Way and being 'lost,' the Milky Way has a strong gravitational pull which enables this gas and dust potentially fundamental to life to be retained. This clinging of the stellar products gravitationally to the Galaxy is analogous in some ways to sea life which clings to the protective coral reef. It is perhaps the fact that we have such astronomical equivalents of coral reefs that allows the congregation of the heavier elements needed to bring about life on our own little blue planet.