Is a battery's internal resistance a function of integrated current over time?
A cell is a bunch of chemicals between two electrodes.  A chemical reaction produces an excess of electrons on one terminal, and a lack of electrons on the other.  Once the potential difference reaches a certain level (the voltage of the cell), the reaction slows to a halt.

If you connect a load to the battery, the electrons can travel between the two terminals.  The reaction re-starts and generates more electrons.

But there's a limit to how fast the reaction can run.  Take too much current, and the voltage drops.  To a reasonable approximation, this looks like the cell is a constant voltage source in series with a resistor.  But there isn't actually any resistor inside the cell.

As the cell ages, the chemicals run out, and this limits the rate at which it can generate current.  Effectively, the internal resistance has gone up.

If you overload a primary cell, the chemicals in contact with the electrodes are used up faster than the diffusion within the cell can keep up.  The internal resistance increases, and the cell looks flat.  But give it a few minutes (particularly in a warm place), and the chemicals can re-mix again, and the cell recovers.