<i>Context. <i/>The dynamical escape of stars from star clusters affects the shape of the stellar mass function (MF) in these clusters, because the escape probability of a star depends on its mass. This is found in <i>N<i/>-body simulations and has been approximated in analytical cluster models by fitting the evolution of the MF. Both approaches are naturally restricted to the set of boundary conditions for which the simulations were performed.<i>Aims. <i/>The objective of this paper is to provide and to apply a simple physical model for the evolution of the MF in star clusters for a large range of the parameter space. It should also offer a new perspective on the results from <i>N<i/>-body simulations.<i>Methods. <i/>A simple, physically self-contained model for the evolution of the stellar MF in star clusters is derived from the basic principles of two-body encounters and energy considerations. It is independent of the adopted mass loss rate or initial mass function (IMF), and contains stellar evolution, stellar remnant retention, dynamical dissolution in a tidal field, and mass segregation.<i>Results. <i/>The MF evolution in star clusters depends on the disruption time, remnant retention fraction, initial-final stellar mass relation, and IMF. Low-mass stars are preferentially ejected after <i>t<i/> ~ 400 Myr. Before that time, masses around 15–20% of the maximum stellar mass are lost due to their rapid two-body relaxation with the massive stars that still exist at young ages. The degree of low-mass star depletion grows for increasing disruption times, but can be quenched when the retained fraction of massive remnants is large. The highly depleted MFs of certain Galactic globular clusters are explained by the enhanced low-mass star depletion that occurs for low remnant retention fractions. Unless the retention fraction is exceptionally large, dynamical evolution always decreases the mass-to-light ratio. The retention of black holes reduces the fraction of the cluster mass in remnants because white dwarfs and neutron stars have masses that are efficiently ejected by black holes.<i>Conclusions. <i/>The modeled evolution of the MF is consistent with <i>N<i/>-body simulations when adopting identical boundary conditions. However, it is found that the results from <i>N<i/>-body simulations only hold for their specific boundary conditions and should not be generalised to all clusters. It is concluded that the model provides an efficient method to understand the evolution of the stellar MF in star clusters under widely varying conditions.