They're attracted to the sound of your footsteps.
Well, damn those zombies sure do have a good sense of hearing.
Although, are you really sure of that? Because sometimes, when I am running around town with my full night vision, I run past zombies and they don’t seem to give a damn, but hearing footsteps on the other side of a wall is enough to let them go crazy?
Probably, once the first zombie starts whumping at the wall the others get attracted too and start smashing as well. God forbid they smash something that was secured with an alarm, though…