Most of what astronomers know about the universe comes from what they can see. So their ideas have been prejudiced toward stars and galaxies, which are bright. But most of the regular matter in the universe is in the form of gas, which is dim. Gas called the “intergalactic medium” fills the space between galaxies; the gas of the “circumgalactic medium” surrounds galaxies more closely. The gas in both places regulates the birth, life, and death of the galaxies, and holds a detailed history of the universe. Only lately have astronomers been able to detect it.
Shortly after its birth, the universe was filled with gas, mostly hydrogen. Over time, here and there, gravity pulled the gas into clouds, which turned into galaxies and in which stars ignited. Stars shine by thermonuclear burning of the gas; of those that die in explosions, some blow the gas back out of the galaxies. Out in intergalactic space, the gas cools and gets denser, until gravity pulls it back into the galaxy, where new stars form. The process repeats: Gravity condenses gas into galaxies and stars, stars blow up and kick the gas out, gravity cycles the gas back in and makes new stars.
In time, any given galaxy begins to run out of recyclable gas. Without gas, it can’t form new stars; the old stars live out their life and die, and eventually the galaxy dies, too. Galaxies sit in a bath of gas, the medium from which they were born and that fuels them. The galaxies breathe gas in and out, and their stars burn until their gas is gone.