Gravity acts as the container. It takes cold gas, otherwise the kinetics involved keep the gas dispersed like you state. But once the gas cools enough it no longer has enough energy to hold itself apart against gravity and begins to contract. This of course starts increasing the temperature of the gas, but momentum inwards and the increasing gravity from the larger mass contracted into a smaller volume fight the outward push from the increasing heat. Eventually the heat being generated will blast away the further parts of the in falling gas that were too far away before the new star got too hot.
Edit for grammar. Typing is hard.
Latest Answers