A battery works by converting chemical energy into electrical energy. When a battery is connected to a circuit, a chemical reaction occurs within the battery, causing electrons to flow from the negative terminal to the positive terminal through the circuit, creating an electric current. This flow of electrons is what powers devices like cell phones, flashlights, and cars.