The 20G barrels are smaller in diameter, so the volume of content (not sure if that is the right term) is lower. The powder ignites and turns into (a lot of) gas. The expansion of the gas yields pressure, pushing the projectile out the barrel at speed. Less room means higher pressures can be reached with less gas - so even if the 20G has less powder, it could still reach the same (or higher) velocities as its 12G cousin. If the cartridges were like for like in powder content, I would imagine that the pressure would (continue to) build quicker in the smaller barrels and the 20G would have a higher velocity at muzzle than the 12G.