Does battery affect how engine runs

I agree with Manolito completely that a weak battery or cable end can cause poor engine performance. It’s amazing that your battery lasted this long; most go belly-up in about 5 years.

When I owned my old Sable I could always detect when the cable ends needed cleaning because when the current draw was high (lighting, A/C, etc. and especially at idle) the engine would develop a subtle stumble and sometimes stumble at speed.
I chalked this up to poor conections and a high current draw dropping the voltage down too much. When the voltage drops everything in the system is going to be affected.

Every single time when the cable ends were loosened a faint scale was present on the mating surfaces and when cleaned with a terminal cleaner the stumble would go away.