A rivet gun differs from an air hammer in the precision of the driving force.
Pneumatic rivet guns typically have a regulator which adjusts the amount of air entering the tool.
Regulated air entering passes through the throttle valve which is typically controlled by a trigger in the hand grip.
When the trigger is squeezed, the throttle valve opens, allowing the pressurized air to flow into the piston.
The fast-hitting gun strikes multiple light-weight blows at a high rate as long as the trigger is held down.
The stationary (fixed) jaw is placed against the head and the buck is compressed by the action of the gun.
This forms another "head" on the opposing side to the workpiece, drawing the work together and holding it securely in place.