scaling of density

Distances in cosmology scale in proportion to $a$ as well as with \(1/h\): Why is it that the matter density \(\rho\) scales \(\propto a^{-3}\) and at the same time \(\propto h^2\)?