Tilt Switch actually just work as a simple switch to make open and closed circuit.
Open a tilt switch, we can see there are to conductive balls inside a copper tube. There are two pins with this switch, one connected to the outer copper tube, and another one go into the tube and which would connect with the rolling ball in there.
The circuit closed when the balls are conducted with the copper tube and inner pin. Conversely the circuit open when turning the switch upside down that avoid the small ball to touch the pin.
But why there are two balls? One is bigger and another is smaller. I think the bigger ball actually has two function. First it helps to conduc with the copper tube; second, it is heavier that would provide the weight to help the smaller ball stably conduc with the pin.