The OEM pad kit comes with two sensors (one for each wheel). The sensor is a little electrical device that plugs in a socket somewhere on the brake caliper.
It's only function is to light up your brake indicator on the dashboard to let you know when your brakes are approaching the end of the safe wear limit (much more sophisticated than hearing that god-awful scraping sound that the metal indicators on other makes have).
The sensors probably don't need to be replaced every time the pads do, but the sensors do seem fragile considering what they're exposed to, so if you get a lot of life out of your brake pads, it wouldn't hurt to get those replaced too.
The dealer here charges me about $120 for the kit...even comes with that ointment stuff that you apply to the pads before assembly, so your brakes don't make a bunch of noise when you press the pedal...
2009 ML350 (84K) - Family vehicle
2001 CLK430 Cabriolet (71K) - Wife's car
2005 BMW 645CI (124K) - My daily driver
2012 Mustang V6 (60K) - Daughter's car