The ability to identify which direction a sound is coming from is called localisation. This is possible due to binaural hearing, which refers to hearing with both ears.
The anatomical layout of your ears on either side of your head allows your brain to compare the subtle differences in time and loudness of sounds reaching each ear. These spatial cues are fundamental to determining the location of a sound source.
Spatial hearing allows your brain to detangle and organise the complicated soundscapes that occur in noisy environments and focus on hearing and understanding a particular sound source. This is known as the cocktail party effect, as it describes how a partygoer can focus on a single conversation in a noisy room. However, your brain works hard to spatially separate a sound from competing, simultaneous sound sources and most people will find this becomes exhausting quite quickly.
If you suffer from hearing loss, the process of spatial hearing is disrupted, which makes it even more difficult to understand and track conversation in a room where there is background noise as your brain struggles to differentiate one sound from another. This is especially true for people who have hearing loss in only one ear.