Accelerators measure motion over time, and this is key to how the Apple anti-theft idea works. It all begins with an acceleration sensor (which could be one or a group of accelerometers and the software required to make them work) continually monitoring the acceleration (motion over time) of your iPhone. Think of this as your phone getting to know you and how delicate or rough you are with it, the baseline acceleration signal for your phone.
That stream of data is filtered and compared to a series of characteristics known to happen in situations when theft is occurring; Apple has figured out that when a device is being stolen the data collected by the accelerometer -- the acceleration signal -- looks different than during those instances when the device is been dropped or during other types of everyday impact and usage. Apple calls these scenarios theft conditions, and there are filters designed to distinguish those frequency types and lengths from those in your baseline. For example, while you might like to run with your iPhone, characteristics of a theft condition might include frequencies that indicate running in addition to abrupt changes in direction or jumping movements.
Theft conditions are basic rules for when an alarm should sound (when someone snatches your phone and runs) or not (when your phone is jostled in your pocket). If the data matches characteristics of a theft condition, a signal is sent to the phone's microprocessor -- and that's the message the microprocessor needs to trigger the alarm to sound through the speakers.
While some may prefer to stick with the default settings, Apple's anti-theft device would allow users to edit their theft detection profile (as well as turn it on or off) through a user interface in their phone settings, including whether or not an alarm should sound during a theft, how loud the alarm should sound and also whether or not a message should appear on the device screen (and what that message should read). Users would also set a password to disable the alarm, as well as calibrate the sensitivity of their iPhone's theft detection system.
Despite how smart your phone may be, if it's slyly pocketed while your attention is diverted, don't rely on an alarm to sound. Chances are low it would be able to discern that kind of device-in-pocket motion as anyone other than you.