  Almost all of the extragalactic X-ray background (XRB) at 0.25 keV can be
accounted for by radio-quiet quasars, allowing us to derive an upper limit of 4
\bgunit\ for the remaining background at 0.25 keV. However, the XRB from the
gas halos of groups of galaxies, with gas removal due to cooling accounted for,
exceeds this upper limit by an order of magnitude if non-gravitational heating
is not included. We calculate this using simulations of halo merger trees and
realistic gas density profiles, which we require to reproduce the observed gas
fractions and abundances of X-ray clusters. In addition, we find that the
entire mass range of groups, from $\sim 5\times 10^{12}$ to $\sim 10^{14}$\Ms,
contributes to the 0.25 keV background in this case. In a further study, we
reduce the luminosities of groups by maximally heating their gas halos while
maintaining the same gas fractions. This only reduces the XRB by a factor of 2
or less. We thus argue that most of the gas associated with groups must be
outside their virial radii. This conclusion is supported by X-ray studies of
individual groups. The properties of both groups and X-ray clusters can be
naturally explained by a model in which the gas is given excess specific
energies of $\sim 1$ keV/particle by non-gravitational heating. With this
excess energy, the gas is gravitationally unbound from groups, but recollapses
with the formation of a cluster of temperature $\ga 1$ keV. This is similar to
a model proposed by Pen, but is contrary to the evolution of baryons described
by Cen \& Ostriker. (abridged)
