The truly complicated thing is how the pressure waves created by the headphone drivers reach the eardrum.
They are not purely acoustic waves. Ever wonder why good bass from headphones requires good seal? Loudspeakers don't need it. Try removing your headphones slowly. When you break the seal, the low bass is gone first. As you remove the headphones further away, the mid-bass goes next, and the disappearing act progressively moves up with frequency. This is completely different from loudspeakers, where attenuation with distance (when not too far) is frequency independent.
The small size of headphone drivers make them "inefficient" acoustic radiators. The low bass propagates as "supersonic" hydrodynamic pressure waves (due to incompressibility). The mid bass (and up) are evanescent waves, where pressure attenuation is exponential with distance (instead of 1/r as normal acoustic waves). So how the "sound waves" reaches the eardrums are also fundamentally different between loudspeakers and headphones.
View attachment 78847
From
An Introduction to Acoustics, which can be downloaded here:
https://www.win.tue.nl/~sjoerdr/papers/boek.pdf
P.S. That's pretty much all I know about this topic. Don't make the assumption that I understand more than 0.1% of the content of the book