Context. Exoplanets in the mass range between Earth and Saturn show a large radius, and thus density, spread for a given mass. Aims. We aim at understanding to which extent the observed radius spread is affected by the specific planetary parameters at formation and by planetary atmospheric evolution, respectively. Methods. We employ planetary evolution modeling to reproduce the mass-radius (MR) distribution of the 198 so far detected planets with mass and radius measured to the ≤45% and ≤15% level, respectively, and less massive than 108 M ⊕ . We simultaneously account for atmospheric escape, based on the results of hydrodynamic simulations, and thermal evolution, based on planetary structure evolution models. Since the high-energy stellar radiation affects atmospheric evolution, we account for the entire range of possible stellar rotation evolution histories. To set the planetary parameters at formation, we use analytical approximations based on formation models. Finally, we build a grid of synthetic planets with parameters reflecting those of the observed distribution.Results. The predicted radius spread reproduces well the observed MR distribution, except for two distinct groups of outliers (≈10% of the population). The first group consists of very close-in Saturn-mass planets with Jupiter-like radii for which our modeling underpredicts the radius likely because it lacks additional (internal) heating similar to that responsible for inflation in hot Jupiters. The second group consists of warm (∼400-800 K) sub-Neptunes, which should host massive primordial hydrogen-dominated atmospheres, but instead present high densities indicative of small gaseous envelopes (<1-2%). This suggests that their formation, internal structure, and evolution is different from that of atmospheric evolution through escape of hydrogen-dominated envelopes accreted onto rocky cores. On average the observed characteristics of low-mass planets (≤10-15 M ⊕ ) strongly depend on the impact of atmospheric escape, and thus of the evolution of the host star's activity level, while primordial parameters are less relevant. Instead, for more massive planets, the parameters at formation play the dominant role in shaping the final MR distribution. In general, the intrinsic spread in the evolution of the activity of the host stars can explain just about a quarter of the observed radius spread.