I recently discovered this answer which explains how batteries maintain a constant potential difference. So what I understood was that batteries spew out electrons on the cathode, and by doing this they create an electrical field. When this field becomes strong enough, it stops the redox reactions occurring in the battery. This causes the potential difference to become constant as there is no more charge accumulation.
The last part didn't really make sense to me, I thought voltage had nothing to do with the charge density. I thought some amount of energy is taken from the electron during the reactions occurring in the battery, creating a potential difference (aka voltage). It wouldn't be too far-fetched to make some connection to charge density as well, but I don't have the knowledge to make such conclusions. So is my original understanding of how a potential difference is generated correct or does charge density also play a role?