  We study the effect of baryons on the abundance of structures and
substructures in a Lambda-CDM cosmology, using a pair of high resolution
cosmological simulations from the GIMIC project. Both simulations use identical
initial conditions, but while one contains only dark matter, the other also
includes baryons. We find that gas pressure, reionisation, supernova feedback,
stripping, and truncated accretion systematically reduce the total mass and the
abundance of structures below ~10^12 solar masses compared to the pure dark
matter simulation. Taking this into account and adopting an appropriate
detection threshold lowers the abundance of observed galaxies with maximum
circular velocities below 100 km/s, significantly reducing the reported
discrepancy between Lambda-CDM and the measured HI velocity function of the
ALFALFA survey. We also show that the stellar-to-total mass ratios of galaxies
with stellar masses of ~10^5 - 10^7 solar masses inferred from abundance
matching of the (sub)halo mass function to the observed galaxy mass function
increase by a factor of ~2. In addition, we find that an important fraction of
low-mass subhaloes are completely devoid of stars. Accounting for the presence
of dark subhaloes below 10^10 solar masses further reduces the abundance of
observable objects, and leads to an additional increase in the inferred
stellar-to-total mass ratio by factors of 2 - 10 for galaxies in haloes of 10^9
- 10^10 solar masses. This largely reconciles the abundance matching results
with the kinematics of individual dwarf galaxies in Lambda-CDM. We propose
approximate corrections to the masses of objects derived from pure dark matter
calculations to account for baryonic effects.
