Why dark matter scales in the same way as the ordinary matter? How do we know that the energy density of dark matter in the Universe scales as that of ordinary matter in the expanding Universe? Is it a guess?
 A: There are two types of Dark Matter, Hot, and Cold.
The density fluctuations in the early universe, galaxy formation, BAO oscillations seem to favor the cold dark matter (CDM) over the hot dark matter (HDM) (e.g., neutrinos).
Let us take the WIMPS (weakly interacting massive particles) as our CDM candidate.
Since they are massive ($\approx 50 - 100$ GeV) they must have been decoupled in the early universe after they become non-relativistic.
In other words, if it was non-relativistic ($w_{CDM} = 0$) in the very early times, and it must have remained like that until now. So they scale as the baryonic matter.
Mathematically we say that,
if, $kT \gg m_xc^2$ the particle is relativistic.
if, $kT \ll m_xc^2$ the particle is non-relativistic
So, if we say that the mass of the WIMP is between $50-100$ GeV, we can calculate when it become non-relativistic, which is around $T_{dec} \approx 10^{15} K$ (this corresponds to $t \approx 10^{-9}$ second).
So after this point, they just basically scaled as baryonic matter.
Note:
The calculate this,
take the boltzmann constant $k = 1.380649 \times 10^{-23} JK^{-1}$ and $100GeV  = 1.60218 \times 10^{-8} J$
so
$$T = m_x/k = \frac{1.60218 \times 10^{-8}}{1.380649 \times 10^{-23}} \approx 10^{15}K$$
