The collapse of an isolated, uniform and spherical cloud of self-gravitating particles represents a paradigmatic example of a relaxation process leading to the formation of a quasi-stationary state in virial equilibrium. We consider several N-body simulations of such a system, with the initial velocity dispersion as a free parameter. We show that there is a clear difference between structures formed when the initial virial ratio is and b0>bc0. These two sets of initial conditions give rise respectively to a mild and violent relaxation occurring in about the same time-scale; however, in the latter case the system contracts by a large factor, while in the former it approximately maintains its original size. Correspondingly, the resulting quasi-equilibrium state is characterized by a density profile decaying at large enough distances as r−4 or with a sharp cut-off. The case b0<bc0 can be well described by the Lynden-Bell theory of collisionless relaxation considering the system confined in a box. On the other hand, the relevant feature for b0>bc0 is the ejection of particles and energy, which is not captured by such a theoretical approach: for this case we introduce a simple physical model to explain the formation of the power-law density profile. This model shows that the behaviour n(r) ∼r−4 is the typical density profile that is obtained when the initial conditions are cold enough that mass and energy ejection occurs. In addition, we clarify the origin of the critical value of the initial virial ratio bc0.