The physics
A real cell has an emf E and an internal resistance r. The current passes through r too. So the voltage at the cell's ends, its terminal voltage, is less than E.
I = E/(R + r) V = E − Ir
Cells in a line add their emfs and their internal resistances. Equal cells side by side keep the emf E, and r falls.
n in a line: nE and nr m side by side: E and r/m
Cells side by side may differ. Then use the junction law on the wire they share. A load takes the most power when its resistance equals r.