How does a roll/sway bar in racing cars work? What is the basic requirement for installing it?

How does a roll/sway bar in racing cars work? What is the basic requirement for installing it?

       An Anti-Roll/Anti Sway/Sway bar is a bar which connects the opposite wheels(left/right) through short lever arms linked by a torsion spring.A sway bar resists body roll motions. It makes sure that both the wheels are at the same height. It prevents rolling of the car during sharp turns. Consider you are driving a sharp corner, the car shifts towards the outer wheels.Now the Sway bar pulls the inner wheels towards the car.This makes the car get stuck to the road thus,preventing an accident.After the fast turn, then the downward pressure is reduced, and the paired wheels can return to their normal height against the vehicle, kept at similar levels by the connecting sway bar.