Shouldn't we have roughly the same battery life regardless of the frequency since the higher the frequency is, the faster tasks will complete so in the end the CPU, despite running at a higher frequency is less used than if it was running at a lower frequency ?
Actually generally these days lowering the frequency doesnt save battery power.
It used to do this because the relationship between power and speed is not linear. Running at 50% speed does not mean it only takes 50% as much power. The curve generally tends to be exponential in nature, so you might save 20% power by lowering the speed to 90%, but going down to 80% might only increase the power savings to 30%, and 50% speed might save only 35% power. Thus, if you run at 90% speed, it might take you 10% longer to do a task, but that is more than made up for by the 20% power savings. Trying to run at 50% speed though ends up costing you more energy since you spend twice as long but only save 35% ( 2 x 0.65 = 1.3x the energy ).
These days though, processors have deep sleep states they can automatically enter when idle, during which their power consumption drops to zero. That makes it better to hurry up and get the work done, so it can go back to sleep. For example, spending 1 time unit at 50% speed would cost 0.65 energy units, but spending 0.5 time at 100% speed and the other half sleeping costs only 0.5 energy.
The exception to these circumstances is if you have a stupid application that likes to waste all of the cpu time it can get, without really getting anything done. If that is the case, then you can save a lot of power by manually dropping the frequency since it saves power, and does not take more time to finish the task.
It would seem that should be the case, but it isn't. Ultimately it's not about the power the CPU uses over time. It's about the power being used per task, or efficiency.
Let's say you have two people who need to run to the store that's a mile away. One decides to walk, and the other decides to run. Running takes more energy than walking, but you get there faster. Yet if you look at both people when they arrive the runner is much more exhausted. That's because the runner used proportionally more energy than the walker to do the same job. The walker was more efficient with their energy.
CPU's work in the same way. You can think of it in terms of how much power is used per cycle. A CPU running in a low power mode will take longer to perform a task but it is using less power per cycle to accomplish the same job.
Laptop CPUs run at lower frequencies than desktops – thus, they consume less power with diminished heat. So basically the lower frequency allows for less fan usage, so therefore you are saving even more battery power by not having to run the fan as much as you would if it were running harder and faster.