From what I see it is wanted mostly to give to some units the abilities to switch between ranged and melee attacks. But I think it is more complex than that.
The cases I identified are:
Infantry ranged and infantry melee.
Cavalry melee and cavalry trampling.
Cavalry charged attack and cavalry melee.
Naval ranged and naval melee (ramming).
Siege ranged and siege melee.
Elephant ranged and elephant melee.
In some cases, the wanted feature is a switch between melee and ranged that would be manually activated.
In other cases it is multiple attacks simultaneously like archers on elephants and siege towers with battering ram.