What is a accelerometer?

An accelerometer is a device that measures the changes in gravitational acceleration in a device in which it got installed. These are used to measure acceleration, tilt and vibration in many devices [1]
In concept, accelerometer behaves as a damped mass on a string. When it experiences acceleration, the mass is displaced to the point that the spring is able to accelerate the mass at the same rate as the casing. The displacement is then measured to give the acceleration [2]
There are also electro-magnetic accelerometers which may measure both static and dynamic acceleration forces. In computers, Apple and IBM companies started to use accelerometers in their laptops to prevent hard drive damage. So, if your laptop starts falling suddenly, these will detect the acceleration and switch your hard drive off so the heads don't crash on the platters. [3]
In cars, accelerometers detect car crash and deploy the air bags at the right time.
They also have applications in engineering, biology, mechanics, medical applications, navigation, valcanology etc.
Sources and Further Reading -
[1] https://whatis.techtarget.com/definition/accelerometer
[2] https://en.wikipedia.org/wiki/Accelerometer
[3] https://www.dimensionengineering.com/info/accelerometers