The Ah rating shows how much energy is stored in the battery. In a roundabout way, it shows how long the battery will last. An ampere-hour combines the amount of current with the time taken for a battery to completely discharge.
Battery stores charge in the form of chemical energy and then converts it into electrical energy to utilize for a specific time. The amount of available charge is the capacity of a cell or battery which may be expressed in Ah (Ampere-hour).
The battery is not a constant voltage source i.e., we are only interested in battery capacity, which is only for a specific time, hence we can't use Wh instead of Ah for the battery as well.
Example: A 12-volt 3 Ah battery can deliver 12v at 3 amps for 1 hour. Or 12v at 0.3 amps for 10 hours and so on.