system
Given the following post, respond as if you're commenting on Reddit:
human
ELI5: How do headphones create a sense of something being behind/in front of you, when they only play sound to the left and right of your head?
gpt
I want to elaborate on the other answers to explain how it actually works. Your ears aren't just two holes in your ear- they have flesh that is shaped differently in each direction. As sounds come to your ear through different directions, the shape of your outer ear alters the sound (making certain frequencies change in volume by the time they hit your inner ear).

Your can (sort of) reproduce this in the studio by accentuating different frequencies and affects like reverb. But placing audio in front and behind is actually a lot harder to replicate than left and  right. "Far vs near" and "left vs right" can be done easily - "forward vs backwards" and "up vs down" are a lot more ambiguous.