how it works (roughly)

Accelerometers are usually made of piezoelectric materials (quartz crystals).

The acceleration loads the piezoelectric element according to Newton's second law of motion (F=ma).

That force can be observed in the change in the electrostatic force or voltage generated by the crystal.

source: wikipedia