Gears change how many times the wheels turn for every engine revolution.
Engine power is the product of angular velocity (rpm) and torque.
Gears are tangentially related to engine power output since they allow a user to select how fast the engine is spinning, but an engine outputs the same amount of power at a specific RPM regardless of what gear the transmission is in. 1800 RPM in 1st gear and 5th gear will generate the same amount of kW (or HP, if you prefer)