The most common type of hearing loss is age related hearing loss. This type of hearing loss makes it difficult to hear high frequencies. The main thing a hearing aid does is compensate for this by adjusting the volume of high frequencies. But here's what you're missing - The key is to amplify at low volumes and reduce at high volumes, AKA dynamic range compression [2]. This allows people to hear better at low volumes but not blast their ears at high volumes.
FYI - The ear piercing shriek you heard was from poor feedback cancellation on the hearing aid. Hearing aids have a microphone and speaker so feedback is common and a nightmare.
Also, I'm the founder of AudioFocus (YC S19)
[1] http://www.hearingresearch.org/ross/hearing_loss/the_audiogr... [2] http://openaudio.blogspot.com/2017/01/the-need-for-dynamic-r...