what does the tail rotor do on a helicopter
Tail rotors are simpler than main rotors since they require only collective changes in pitch to vary thrust. The pitch of the tail rotor blades is adjustable by the pilot via the anti-torque pedals, which also provide directional control by allowing the pilot to rotate the helicopter around its vertical axis.
It is the same for helicopters. With no floor to push off of, a helicopter in the air tries to quickly twist the rotor to the left, and the fuselage will start spinning to the right. The tail rotor pushes the fuselage back to the left and cancel out the spin. But then this adds a slight overall drift to the right.