Look at it this way.
Ships are on top looking down. They cant hear to the sides. Ships could not hear submarines when they are surfaced. Indeed this was a big motivator for surface attack.
Subs are below looking up. Once they are on the surface well there is no more 'up'.
(Substitute the word listen for looking