In my experience battery life depends mostly on 3 factors.

First, the initial quality of the battery.

Second, the number of times the battery is cycled (discharged and then recharged).

Third, the depth of the cycles (how far it is run down on each cycle).


Initial quality now is horrible compared to the 1980's for example.
Regarding the 2nd and 3rd factors, I usually use the biggest battery I can fit to the application.
That way the depth of each cycle as a proportion of the battery capacity is much less.
Seems to make a big difference for me.

Several times now I've had a new battery almost completely discharged for some reason or other, and when then recharged, they are DONE.
They don't survive even 1 cycle that deep.

On the other hand, I have one battery on the farm from 1985 and 1 from 1997 that are still fine.
But in both cases the engines start scary fast (like 1st compression fast) and hardly cycle at all.