Air bubbles are buoyant. Each time you tap/bump/bang the developing tank, you're momentarily subjecting it to hundreds of times the acceleration of gravity, which multiplies the force on each tiny bubble by hundreds of times as well -- which is what causes the bubbles to move away from any place they've adhered due to surface tension.
Clearly, you don't want to bang the tank so hard to break it (if plastic) or dent it (if steel), but otherwise, two or three sharp raps is about the same as one massive whack -- but safer, if you use a plastic tank.
Any sort of agitation increases contrast in comparison to none, because it ensures there's fresh(er) developer available at the surface of the emulsion, where without agitation, there's an opportunity for the developer to exhaust locally where there's more exposed halide to develop. There are no significant difference in density in the liquids with in the tank, however, so banging the tank does not, of itself, increase agitation effectiveness -- something needs to cause the liquid to move around in the tank, relative to the emulsino surface, to do that. Swirling (like cognac in a snifter), twirling with the swizzle stick, inversion, rocking (substitutes for inversion in some tank types), sliding back and forth (Kodak's method for hanger tanks) -- something that actually makes the developer move.