They're in a kind of balance between gravity pulling in and gas pressure pushing back out.
Gravity wins, and the material crunches down into a disc that is the beginning of becoming a star.
As gravity pulls more and more gas towards the center of the disc, it gets denser and denser and hotter and hotter until finally, at 18 million degrees, a miraculous transformation takes place.
Hydrogen atoms fuse together to form helium, and with a burst of nuclear energy, a star begins to shine.
These stars eventually get their nuclear fires going in the core.
And when they do, they heat up, they can expel the material that's around them so that it kind of clears up the neighborhood.
Over the next few million years, winds blow the surrounding gas into spectacular swirling patterns.
It blows away the gas, it blows away the dust, and it lets us see this beautiful new thing, this place where the star has been born.
A human lifetime is too short to witness the wonder of a star's birth in the spiral arms.
But by speeding up millions of years of cosmic time into just a few seconds, we can see one star born after another.