system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How can electronics with rechargeable batteries tell how much energy is left?

My laptop can tell me exactly what percentage of the battery is remaining, but what is this number based off of?
gpt
A fully charged battery will be at a certain voltage. As the batteries energy is depleted the voltage will drop. A fully depleted battery will have a voltage of zero. By monitoring the battery voltage the device can estimate available battery power.