A rechargeable battery stores energy to be released only when needed. ADP (adenosine diphosphate), with two phosphate groups attached to it, and ATP (adenosine triphosphate), with three phosphate groups attached to it, act in a similar way.
When a cell has extra energy (from food or photosynthesis), it stores this energy by attaching a free phosphate molecule to ADP. As ADP already had two of those molecules, when we add one more it becomes ATP, having three phosphate molecules attached to it. We can relate it to the state of the battery when it is charged.
ATP can then make this energy available, but for that it must release one phosphate molecule, becoming ADP again because only two phosphate molecules would remain. We can relate this to the state of the battery being used and releasing energy.