When the terrain favors neither side, it is down to the disposition of forces in the battle line to prevent flanking attacks.
If the battlefield conditions are not favorable to either side, it's the deployment of troops along the front that prevents flanking maneuvers.