It does depend on battery capacity. iPhones have lower battery
capacity, which means it will charge faster than a Galaxy S4
yes, it depends on the battery ampere hour capacity (Ah)...
The formula for Ah is as follows,

as you can see, the higher the efficiency of disharge path, cell
voltage, number of cells, number of batteries in parallel, and
depth of discharge allowed, the lower the capacity (Ah).
these factors (the components at the denominator) enable the
phone to charge faster.
:. lower Ah = faster charging