Solution (source code)

= Solution

The term $2H\dot\delta$ is <Hubble friction> in the equation for the <density contrast>. During expansion, $H>0$, it damps the peculiar motion producing density growth. It therefore slows <gravitational instability> relative to the otherwise identical static model; it does not necessarily stop growth.

Multiplying by $a^2$ shows the mechanism without confusing it with microscopic dissipative friction:
$$
\frac{d}{dt}(a^2\dot\delta)=4\pi G\rho_m a^2\delta.
$$
When the self-gravity term is negligible, the <expansion-weighted derivative of a passive density perturbation> is conserved, so $\dot\delta\propto a^{-2}$. Expansion also reduces $\rho_m\propto a^{-3}$ and hence weakens the source on the right. A contracting background has $H<0$ and reverses the sign of this effect.