Balancing units/new race is really hard, as you have to consider practically everything.
What others didn't mention are for example the following:
- attack range
- attack speed
- attacks enabled
- build time
- food cost
- gold & lumber cost
- level
- role
- availability
Compare Footman and Knight for example. You can see that Knight is quite a lot better than Footman - he has greater health pool, more armor, higher damage, a lot faster. However he can be build only in late midgame/endgame, because he requires Castle. Training one Knights is both resource and time consuming.
However Footman, while weaker than Knight, is still a good choice when facing a lot of ranged units with Piercing type of attack, since he can "Defend" against them, making him still useful.
---
You can also compare orc Demolisher and Troll Batrider - both have Siege type of attack. Demolisher has greater range and higher damage, but has very low attack and movement speed and also has minimum range for attacks, making it very fragile against melee enemies... on the other hand Batrider has higher attack speed, is flying unit so only certain units can attack him and is quite fast, so he can get away from trouble - but he has less health and a lot lower damage.