We obtain sharp upper and lower bounds for the moderate deviations of the volume of the range of a random walk in dimension five and larger. Our results encompass two regimes: a Gaussian regime for small deviations, and a stretched exponential regime for larger deviations. In the latter regime, we show that conditioned on the moderate deviations event, the walk folds a small part of its range in a ball-like subset. Also, we provide new path properties, in dimension three as well. Besides the key role Newtonian capacity plays in this study, we introduce two original ideas, of general interest, which strengthen the approach developed in cite{AS}.