Early-type galaxies (ETGs) are observed to be more compact, on average, at $z gtrsim 2$ than at $zsimeq 0$, at fixed stellar mass. Recent observational works suggest that such size evolution could reflect the similar evolution of the host dark matter halo density as a function of the time of galaxy quenching. We explore this hypothesis by studying the distribution of halo central velocity dispersion ($sigma_0$) and half-mass radius ($r_{rm h}$) as functions of halo mass $M$ and redshift $z$, in a cosmological $Lambda$-CDM $N$-body simulation. In the range $0lesssim zlesssim 2.5$, we find $sigma_0propto M^{0.31-0.37}$ and $r_{rm h}propto M^{0.28-0.32}$, close to the values expected for homologous virialized systems. At fixed $M$ in the range $10^{11} M_odot lesssim Mlesssim 5.5 times 10^{14} M_odot$ we find $sigma_0propto(1+z)^{0.35}$ and $r_{rm h}propto(1+z)^{-0.7}$. We show that such evolution of the halo scaling laws is driven by individual haloes growing in mass following the evolutionary tracks $sigma_0propto M^{0.2}$ and $r_{rm h}propto M^{0.6}$, consistent with simple dissipationless merging models in which the encounter orbital energy is accounted for. We compare the $N$-body data with ETGs observed at $0lesssim zlesssim3$ by populating the haloes with a stellar component under simple but justified assumptions: the resulting galaxies evolve consistently with the observed ETGs up to $z simeq 2$, but the model has difficulty reproducing the fast evolution observed at $zgtrsim 2$. We conclude that a substantial fraction of the size evolution of ETGs can be ascribed to a systematic dependence on redshift of the dark matter haloes structural properties.