The standard answer to this question is that our brain picks up the tiny difference between the times at which a sound arrives at each ear, and from this figures out where the sound is coming from. But simply selecting points with a particular difference in their distances will yield an entire conical surface of possible origins. Distance, I suppose, can be judged from the softness of the noise, but how do we tell which of the possible directions the sound is actually coming from?