It's because we have two ears and they are on the same horizontal plane but displaced by (approx.) six inches. When an object emitting sound is equidistant from our ears(ie straight in front, straight behind or directly overhead) the sound signals reach the ears at the same time and our brain processing of the sound and the coinciding arrival times tells us that the sound is directly in front or behind or overhead. When the sound is to the left or the right, our brain uses the minute difference in arrival times of the signal to the two ears to locate whether the sound comes from left to right. Our ear/brains register frequency, loudness and time plus a host of other criteria. Telepathy uses some of the same brain regions, as does internal thought, which is why we 'hear' ourselves think.