The tiny quantum fluctuations that drove the expansion could also have given rise to small variations in the amount of matter from one place to another, seeding the later gravitational growth of stars and galaxies.
BBC: The first fractions of a second after the Big Bang