Wh is a unit of energy, Ah is a unit of electric charge, basically how many physical electrons passed by.
The voltage of a battery goes down gradually as it is discharged, so getting an accurate value for total energy dissipated is very complicated, as this varies greatly with the discharge profile and other physical factors like the age/health of the battery.
The one thing that stays constant is the amount of electric charge a battery can provide. If it’s old, the voltage of that charge will be lower and go down quicker, but it will be the same total charge.
I agree from a consumer point of view, joules would be a friendlier unit, however it is also a lot easier to game. Electric charge is a much more definite unit in an electrical engineering sense.
If any of what I said is confusing please ask me to clarify, I’m assuming a basic level of electronic literacy but it’s hard to know what knowledge I’m taking for granted as an ex electrical engineer.
mAh is a bigger number than Wh and looks better on packages.
Wait until you hear about µAh. This is the one secret the engineering team doesn’t want the marketing department to know.
Lets use coulomb hours or electron-per-second-hours.
LOL, electrons per second hour is such a cursed unit, it’s going to take some effort to make it worse.