This is a right angle tilt switch with four terminals. Having four terminals improves the electrical contacts when the switch is triggered/closed. A metal ball is freely moving inside of a viscous liquid within the enclosure. If the device is tilted, the ball will move and make contact with the terminals. A four terminal design is used to make the contact smoother with less bounce.
Datasheet