  The discovery of extended gamma-ray emission toward a number of middle-aged
pulsars suggests the possibility of long-lived particle confinement beyond the
classical pulsar wind nebula (PWN) stage. How this emerging source class can be
extrapolated to a Galactic population remains unclear. We aim to evaluate how
pulsar halos fit in existing TeV observations, under the assumption that all
middle-aged pulsars develop halos similar to those observed toward the
J0633+1746 or B0656+14 pulsars. We modeled the populations of supernova
remnants, PWNe, and pulsar halos in the Milky Way. The PWN-halo evolutionary
sequence is described in a simple yet coherent framework, and both kinds of
objects are assumed to share the same particle injection properties. We then
assessed the contribution of the different source classes to the
very-high-energy emission from the Galaxy. The synthetic population can be made
consistent with the flux distribution of all known objects, including
unidentified objects, for a reasonable set of parameters. The fraction of the
populations predicted to be detectable in surveys of the Galactic plane with
HESS. and HAWC is then found to be in good agreement with their actual outcome,
with a number of detectable halos ranging from 30 to 80% of the number of
detectable PWNe. Prospects for CTA involve the detection of 250-300 sources in
the Galactic Plane Survey, including 170 PWNe and up to 100 halos. The extent
of diffusion suppression in halos has a limited impact on such prospects but
its magnitude has a strong influence. The level of diffuse emission from
unresolved populations in each survey is found to be dominated by halos and
comparable to large-scale interstellar radiation powered by cosmic rays above
0.1-1TeV. Pulsar halos are shown to be viable counterparts to a fraction of the
currently unidentified sources if they develop around most middle-aged pulsars
(abridged).
