In a conventional helicopter the lift generated by the rotor is controlled by the collective pitch. Raising the collective pitch increases the Angle of Attack of the the rotor blades and consequently the lift, and inevitably increases drag. The drag is overcome by increasing the torque from the engine. Vertical movement is achieved by balancing the collective pitch against the torque while maintaining a relatively constant rotor speed.
The torque from the engine pushing the rotor one way results in a tendency of the fuselage to rotate in the opposite direction. This is conventionally countered by a tail rotor or other similar device, and varying the force generated by this rotor controls the yaw.
So far, so good.
In a helicopter with coaxial rotors there is no tail rotor, but the torque issue remains. Here, it's resolved by applying equal but opposite torque to each rotor.
Lift overall is controlled by changing the Angle of Attack of both rotors. If the same inputs are applied to both rotors then the torque remains balanced.
However, the Angle of Attack of one rotor can be increased while that Angle of Attack of the second is decreased, leaving lift overall unchanged. This will increase the drag on the first rotor, and hence the torque required to maintain rotor speed.
Simultaneously, the lift, drag and torque on the second rotor has been reduced, producing an imbalance in the direction of torque between the two rotors, and a consequent yaw moment around the axis of rotation.
All this can be achieved without a significant change in rotor speed. In fact, the exact rotor speed doesn't play a part in yaw control.