In the framework of our extensive modeling study of the spectral evolution of white dwarfs, we present here a new set of detailed calculations of the transport of residual hydrogen in helium-rich white dwarfs. First, we investigate the so-called float-up process at high effective temperatures, whereby the upward diffusion of trace hydrogen leads to the formation of a hydrogen atmosphere. We examine the dependence of this phenomenon on the initial hydrogen abundance and on the strength of the radiative wind that opposes gravitational settling. Combined with our empirical knowledge of spectral evolution, our simulations provide new quantitative constraints on the hydrogen content of the hot helium-dominated white dwarf population. Then, we study the outcome of the so-called convective dilution process at low effective temperatures, whereby the superficial hydrogen layer is mixed within the underlying helium-rich envelope. In stark contrast with previous works on convective dilution, we demonstrate that, under reasonable assumptions, our models successfully reproduce the observed atmospheric composition of cool DBA stars, thereby solving one of the most important problems of the theory of spectral evolution. This major improvement is due to our self-consistent modeling of the earlier float-up process, which predicts the existence of a massive hydrogen reservoir underneath the thin superficial layer. We argue that the trace hydrogen detected at the surface of DBA white dwarfs is, in most cases, of primordial origin rather than the result of external accretion.