A compensator redirects propellant gases upward through ports in the top of the device as the bullet exits the barrel. This downward force counteracts the natural upward rotation (muzzle flip) caused by the bore axis sitting above the grip. The result is a flatter-shooting pistol with faster target reacquisition between shots.
Compensator effectiveness depends on three factors: port size and angle (larger ports redirect more gas), ammunition pressure (hotter loads produce more gas to redirect), and comp weight (heavier comps add muzzle weight that resists flip). This is why micro comps like the Griffin Micro Carry Comp offer less reduction than full-size options like the Herrington Arms HC95.
Important distinction: Compensators redirect gas to reduce muzzle flip (upward rotation). Muzzle brakes redirect gas to reduce felt recoil (rearward push). Many Glock "compensators" are technically hybrid devices that address both. The Radian Ramjet Afterburner and Strike Industries Mass Driver use entirely different mechanisms: the Ramjet uses a matched barrel with integrated ports, while the Mass Driver uses a gas-driven counterweight.