Jeans instability theory
Consider a spherical cloud of gas with density $\rho$ and radius $R$. If there were no pressure, the sphere would collapse in the time scale of the free fall time
$$t_{ff} = \sqrt{\frac{3\pi}{32G\rho}}$$
If there is pressure instead, when the cloud starts to compress, pressure will try to oppose gravity and restore the previous size of the cloud. But pressure doesn't act instantaneously, pressure changes propagate at the speed of sound $c_s$. The time it takes for the pressure to react is therefore
$$t_p = \frac{R}{c_s}$$
If $t_p \gg t_{ff}$ the pressure is not fast enough and the cloud collapses, increasing its density. If $t_p \ll t_{ff}$ the pressure reacts and the cloud starts damped oscillations.
It is useful to define the Jeans length $\lambda_J$ or $R_J$ that is the maximum size a given cloud can have before being doomed to collapse and is found by equating $t_p$ and $t_{ff}$.
$$\lambda_J \approx {c_s \over \sqrt{G\rho}}$$
Different components of the universe
In the early universe the main components to the total matter-energy density where:
Dark Matter: has no pressure, therefore $\lambda_J$ is zero. Every clump of dark matter inevitably collapses under gravity, forming dark matter overdensities and gravitational wells.
Radiation: a gas made of photons and relativistic particles has a sound speed that is comparable with the speed of light $c_s \approx c$. $\lambda_J$ is very big, comparable with the size of the causal horizon of the universe. As a consequence, a relativistic gas never collapses under gravity.
Baryonic Matter: before z=1100 photons and electrons where tightly coupled. There were a lot more photons than baryons. The universe was a relativistic soup with $c_s \approx c$.
After z=1100 matter and radiation decouple, and $c_s$ becomes much smaller, the jeans length being about the size of a small galaxy.
A brief history of the formation of structures in the universe
The initial density fluctuations were given (possibly?) by inflation. After inflation, dark matter started collapsing, forming gravitational wells, which later will be fundamental for the formation of galaxies. Baryonic matter instead is coupled with radiation and can only oscillate with very fast and large sound waves.
We know that there is much more dark matter than baryonic matter, but the baryonic oscillations can have a small gravitational effect on dark matter nonetheless. The baryonic oscillations leave a small imprint on the distribution of dark matter. Dark matter oscillates a little bit too.
After the age of decoupling (z=1100) the oscillations freeze. The barions are free to start forming structures and galaxies, but there is so little time! It can be shown that if there were only baryons, the density fluctuation could grow only by a factor of $\approx 1000$ from the age of decoupling to today. This isn't enough to explain the extreme density differences we observe today: a galaxy is much more dense than the surrounding space.
Luckily there is dark matter, which has already formed the convenient potential wells. Baryonic matter just needs to fall into the wells and form galaxies, stars, planets...
But dark matter had felt the oscillations of the baryons, therefore the spatial distribution of potential wells must carry information of these oscillations. This means that if we look at the spatial distribution of galaxies today, we might be able to see that galaxies like to aggregate more on some spatial scales than in others.
Observation of BAO (baryonic acoustic oscillations)
In particular, we may want to look at the two point correlation function of the spatial distribution of galaxies $\xi(r,r')$. Given that there is a galaxy at the position $r$, $\xi(r,r')$ gives the probability that you will find another galaxy at the position $r'$. The Fourier transform of $\xi$ gives the power spectral density $P(k)$. It can be calculated theoretically. Using our best fit cosmological parameters $P(k)$ is the following

Notice the small wiggles to the right of the peak. Those are the imprint of the BAO on the distribution of dark matter, that eventually gives the distribution of galaxies.
This plot is obtained from CAMB web interface, a website were you can choose the cosmological parameters and after a few seconds it calculates the power spectral density, along with the CMB spectrum and other cosmological observables.
The plank satellite has measured the power spectral density and this is the result.

This image was made by "ESA and the Planck Collaboration" (arXiv:1807.06205)