When an enemy has built walls or buildings, and you try to place a building into the fog of war, the game recognizes the structure and doesn’t let you place your own building.
This allows for MAJOR exploits, basically cheating/maphacking.
At the same time, military units and villagers recognize walls in the fog of war, that were NOT discovered by the player.
This again gives you the opportunity of an exploit, by knowing what parts of the map are walled and HOW they are walled.
On the other hand it makes units run into their death a lot of times, as they don’t take the patch that you have DISCOVERED.
This happens a lot in early game, when your scout runs past by the enemy tc.
They should try and take the chosen path until they SPOT the wall and then either get stuck there or try to find their way around.
But NOT run around without having discovered the walls.
Same goes for mountains.