Briefly speaking, Roll Ball Sensor Switch operates using the same theory as any other mechanical switches: the turning on and off action is activated whenever the metal part of a switch is touched. As for the Roll Ball Switches, a tiny ball in the switch rolls when motion is detected, triggering a contact of metal terminals or an alteration of a light path. This will generate the conductive or non-conductive status.
The traditional way to detect the tilt and vibration is using mercury switches. As mercury switch is banned by more and more governments, the use of tiny balls to trigger mechanical touch actions becomes more widespread.