When an entity is ridden by a player and is attacked, it very rarely receives vertical knockback. This is not the case when non-player entities ride other entities. 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.
MC-245420 - Knockback dealt to horses with player riders.mp4
MC-245420 - Knockback dealt to horses with non-player riders.mp4
- 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 entities ridden by players very rarely receive vertical knockback when attacked.
Vertical knockback is very rarely received.
Vertical knockback would be received consistently.