The accelerometer in your phone is a tiny MEMS (Micro-Electro-Mechanical System) device — a microscopic spring with a proof mass, whose deflection is measured capacitively. It can detect accelerations as small as 0.01–0.1 mg (milli-g), which corresponds to about 0.0001–0.001 m/s². This is well within the range of floor vibrations from footsteps and traffic.
We remove the gravity component by high-pass filtering the signal, leaving only the vibration component. Events are logged when vibration exceeds a threshold — scaled to a rough equivalent on the micro-Richter scale for nearby events.
Try: tap the table 30cm from the phone. Slam a door in the room. Have someone walk past.