A battery is used in a CPU to provide power to the CMOS chip, which stores information such as the system time and date, BIOS settings, and hardware configuration information. The CMOS chip requires a small amount of power to maintain its data, even when the computer is turned off.