After the gear is slipped onto the shaft, the key prevents the gear from rotating relative to the shaft.