When a unit is behind cover, the amount of time between when an enemy unit spots the covered unit and when the enemy unit starts firing is increased. If, under normal circumstances, the two units would have equal time between spotting and firing, the unit behind cover will have the advantage and will win the engagement.
Whether or not a unit is considered behind cover depends on both units' distance from that cover. If the cover is more than two thirds the distance away from a unit, that unit will take longer to start firing.
Consider the following: a green machine gunner and a red machine gunner have spotted each other at the same time with cover somewhere between them.
R----------|--------------------G Red has cover
R---------------|---------------G neither have cover
R--------------------|----------G Green has cover
I deduced this from testing within the game using the level editor. In cases where neither unit has cover, green (team 1) always wins. I hope this is limited to the level editor.
EDIT: Two thirds seems to be a rough estimate. I'll do some more testing and see what more I can learn.