Using a statistical sample of dark matter haloes drawn from a suite of cosmological N-body simulations of the cold dark matter (CDM) model, we quantify the impact of a simulated halo’s mass accretion and merging history on two commonly used measures of its dynamical state, the virial ratio η and the centre of mass offset Δr. Quantifying this relationship is important because the degree to which a halo is dynamically equilibrated will influence the reliability with which we can measure characteristic equilibrium properties of the structure and kinematics of a population of haloes. We begin by verifying that a halo’s formation redshift zform correlates with its virial mass Mvir and we show that the fraction of its recently accreted mass and the likelihood of it having experienced a recent major merger increase with increasing Mvir and decreasing zform. We then show that both η and Δr increase with increasing Mvir and decreasing zform, which implies that massive recently formed haloes are more likely to be dynamically unrelaxed than their less massive and older counterparts. Our analysis shows that both η and Δr are good indicators of a halo’s dynamical state, showing strong positive correlations with recent mass accretion and merging activity, but we argue that Δr provides a more robust and better defined measure of dynamical state for use in cosmological N-body simulations at z≃ 0. We find that Δr≲ 0.04 is sufficient to pick out dynamically relaxed haloes at z= 0. Finally, we assess our results in the context of previous studies, and consider their observational implications.