  We propose a kinetic model describing the formation of the strahl and halo
electron populations in the solar wind. We demonstrate that the suprathermal
electrons propagating from the sun along the Parker-spiral magnetic field lines
are progressively focused into a narrow strahl at heliospheric distances
$r\lesssim 1$ AU, while at $r\gtrsim 1$ AU the width of the strahl saturates
due to Coulomb collisions and becomes independent of the distance. Our theory
of the strahl broadening does not contain free parameters and it agrees with
the Wind observations at 1 AU to within $15-20\%$. This indicates that Coulomb
scattering, rather than anomalous turbulent diffusion, plays a dominant role in
strahl formation in these observations. We further propose that the nearly
isotropic halo electron population may be composed of electrons that ran away
from the sun as an electron strahl, but later ended up on magnetic field lines
leading them back to the sun. Through the effects of magnetic defocusing and
Coulomb pitch-angle scattering, a narrow source distribution at large
heliocentric distances appears nearly isotropic at distances $\sim$1 AU. The
halo electrons are, therefore, not produced locally; rather, they are the fast
electrons trapped by magnetic field lines on global heliospheric scales. At the
electron energies $K \lesssim 200\,\, {\rm eV}$, our theory is quite
insensitive to the particular mechanism that produces a population of
sunward-streaming suprathermal particles. At larger energies, however, our
theory indicates that the scattering provided by Coulomb collisions alone is
not sufficient to isotropize a narrow sunward-propagating electron beam.
