I decided to make some adjustments.

The image shows two tables: the red one represents the original game stats, and the blue one represents my version.
As you can see from the checksum on the right, combat stats are more common than magic stats in the original. I tried to balance them out while ensuring that each of the four stat combinations (attack, defense, spell power, knowledge) is unique for all heroes (in terms of distributing percentages as 45-30-15-10).
In total, there could be 24 such combinations. We have 8 hero classes, so we need to choose 8 suitable combinations from these 24, making sure they are as diverse as possible (i.e., we shouldn't simultaneously select combinations like 45-30-15-10, 45-30-10-15, 45-15-30-10, 45-15-10-30, 45-10-30-15, 45-10-15-30).
So, on the one hand, we have a choice of 24 combinations, but on the other hand, this choice isn't entirely free because the selected 8 combinations must be as diverse as possible.
As a result, even with 24 combinations, our 8 won't avoid *approximate* repetitions, and here's why:
Each combination can be considered a combination where only two parameters dominate (45% and 30%). In this case, we get only 6 maximally diverse combinations (from four parameters, you can create 6 groups of 2).
For clarity, here is a diagram:

This is exactly how the developers did it.
Therefore, the other two factions (factions that came with two expansions) will inevitably duplicate existing ones (in terms of the two dominant parameters): dwarves approximately duplicated necromancers (a tendency towards defense and spell power), while orcs duplicated humans (a tendency towards defense and attack).
If two factions are going to duplicate someone in this way, then it should be determined who exactly:
1) In the case of orcs, there are no other options – they will clearly duplicate those who tend towards combat skills (attack and defense), not magic. That is, they duplicate humans.
2) But in the case of dwarves, we have two options: elves and necromancers (defense can be paired with three other stats, but the defense-attack pair is already occupied by two factions, so knowledge and spell power remain). Due to a number of circumstances (for example, the dwarves' inclination towards fire magic, which doesn't require high spell power), I decided to make it so that dwarves would duplicate elves rather than necromancers; that is, they would be inclined towards defense and knowledge, not defense and spell power.
As a result, after considering many options, I concluded that the option that would be mathematically correct (corresponding to the concept of maximum difference between eight combinations) would contradict the game mechanics and canon (for example, it would mean giving an orc or human 15% increase to spell power, which does not correspond to the canon, and also forcing us to increase the dwarf's % for spell power and decrease the % for knowledge, which has already been described as undesirable for dwarves).
Therefore, the balancing was done primarily between the four stats, and then between two groups – combat stats (attack and defense) and magic stats (spell power and knowledge).
I also decided to highlight 4 factions most inclined towards one stat or another (and conversely, highlighted those least suited) - this was partly done by the developers if we consider the probability of stats appearing in orcs. That is, attack-orcs, defense-dwarves, spell power-warlocks, knowledge-mages. The other 4 factions will remain somewhat more balanced, although perhaps the inclination towards attack should have been given to demons.