This may have changed or been updated but when I was playing regularly I was told:
When opposing ground units meet, both units attack and defend simultaneously. (When both are moving)
Doesn't matter who sent the first unit. Stationary units defend only which I trust you already know.
Cheers