When a mob is ridden by a player and is attacked, it very rarely receives vertical knockback. This is not the case when non-player entities ride mobs. Below, I've attached some comparison videos of how vertical knockback is received to horses ridden by players, and to horses ridden by non-player entities.
- Summon a horse with a saddle equipped on it.
- Get two players and label them "Player A" and "Player B".
- Get "Player A" to mount the horse and have "Player B" attack the horse multiple times.
- Have both players observe the knockback dealt to the horse.
- Take note as to whether or not mobs ridden by players very rarely receive vertical knockback when attacked.
Vertical knockback is very rarely received.
Vertical knockback would be received consistently.