This is pretty in-depth imo:
https://eu4.paradoxwikis.com/Land_warfare#Combat_sequence
Having a better general is much more impactful, especially early game, where modifiers like discipline/combat ability are rare and units have low number of pips.
General adds his pips (or to be more accurate, the difference between your and enemy's general pips is added) to the
base damage inflicted by your units, which is then
multiplied by your discipline and combat ability
The calculation is a bit convoluted, but bear with me, Let's assume in a battle, both sides have 1 unit of Halberd Infantry at full strength, with no modifiers from discipline, combat ability, terrain, etc etc, but one side has a 6 shock general and one side has a 0 shock general. Assuming they get the same die roll of 5, the 6 shock general's side will inflict 75 casualties, and the 0 shock general's side will inflict 45 casualties during the first shock phase of the battle. If both sides had 10% combat ability buff, they would inflict 83 and 50 casualties respectively