Fire starter

Why is it that the battery in smoke detectors always run out, and because of this the smoke detector start beeping loudly, in the middle of the night?