If you look through the specifications of a digital camera, one of the first things you should see is the number of pixels its sensor holds. Two figures are usually quoted: the total pixels and those which are effective. Only the effective ones are used for image capture itself - so what's the point of the others?
The answer lies in the processing of an image, and more specifically with noise reduction. The pixels that aren't used for capture line the edges of the sensor, and are shielded from receiving any light. This way the camera has a reference point for a black, unexposed pixel. These do, however, still receive a signal in the form of dark current, which is caused by the thermal activity of the sensor, and is one of the causes of noise in images.
By knowing how much dark current has built up in these pixels during an exposure, the camera can average these measurements out before subtracting this value from the active pixels. Doing so creates a ‘cleaner' signal, and the resulting image will exhibit less noise. This is particularly helpful when shooting long exposures, as the sensor is exposed for longer which generates more activity, and when shooting in high temperatures which themselves exacerbate noise.
The effective pixels are the ones which actually capture incoming light, so these are the only one which end up in the final image. Most cameras also offer settings which reduce the number of pixels for particular images, in order to make them smaller, although this doesn't use fewer pixels at the point of capture, but rather resizes the image as part of its processing.