That's just the result of good ol' PV=nRT, the ideal gas law. It isn't exactly right, since no gasses are ideal (lol=, but it is close enough to describe what (didn't) happen.
Where the temperature of the universe is about 3 K on average these days, it was quite a bit higher back then. In the early universe, T was big enough that the internal pressure of most gas clouds was enough to overwhelm gravity. Galaxies, much less stars, couldn't pull themselves together until they could shed enough heat to allow gravity to take its course.
Understood.
Obviously, according to this article, the Universe was able to cool off rapidly enough for gravity to concentrate the mass into stars.