So what does this actually do to the sound?An iPhone doesn't just have a microphone. It has 4 microphones.[1] And it has the ability to do some very sophisticated DSP on the sounds it receives.
So, unless your hearing aids communicate with each other (L and R) in real time, the iPhone might be able to do a better job. That's theory. Does it actually work that way in practice? I don't know.
It would be nice if Apple also did custom EQ like your hearing aids do. It would be pretty easy to add something like that in software, the hardware can certainly do it.
[1] https://www.quora.com/How-many-mic-does-the-iPhone-have (hopefully a Quora link is trustworthy)