Horde Mechanics: How do they work?

They do seem to still wander around slowly and appear in cleared areas. I’ve cleaned a huge space around my base, and there are multiple layers of walls, but zombies still show up inexplicably from time to time.