Context. A positive power-law trend between the local surface densities of molecular gas, Σ gas , and young stellar objects, Σ , in molecular clouds of the solar neighbourhood has recently been identified. How it relates to the properties of embedded clusters, in particular to the recently established radius-density relation, has so far not been investigated. Aims. We model the development of the stellar component of molecular clumps as a function of time and initial local volume density. Our study provides a coherent framework able to explain both the molecular-cloud and embedded-cluster relations quoted above. Methods. We associate the observed volume density gradient of molecular clumps to a density-dependent free-fall time. The molecular clump star formation history is obtained by applying a constant star formation efficiency per free-fall time, ff . Results. For the volume density profiles typical of observed molecular clumps (i.e. power-law slope −1.7), our model gives a stargas surface-density relation of the form Σ ∝ Σ 2 gas , which agrees very well with the observations. Taking the case of a molecular clump of mass M 0 10 4 M and radius R 6 pc experiencing star formation during 2 Myr, we derive what star formation efficiency per free-fall time matches the normalizations of the observed and predicted (Σ , Σ gas ) relations best. We find ff 0.1. We show that the observed growth of embedded clusters, embodied by their radius-density relation, corresponds to a surface density threshold being applied to developing star-forming regions. The consequences of our model in terms of cluster survivability after residual starforming gas expulsion are that, owing to the locally high star formation efficiency in the inner part of star-forming regions, global star formation efficiency as low as 10% can lead to the formation of bound gas-free star clusters.