Filters have the ability to selectively modify sound, so only the sounds needed by the person with a hearing loss are amplified. Also, some have the ability to filter out unwanted noise. The third component is a speaker. The speaker changes the electrical signal which has been amplified and filtered back into an acoustic signal which the wearer hears. The wearer can control the loudness with a volume control.
Some aids have other controls which can be used to make the signal more clear.
Hearing aids cost about the same as a high quality stereo sound system. The high cost results from having to miniaturize the components. Imagine how difficult it is to make microphones and speakers which are small enough to fit into the plastic cases which can be worn on, or in, the ear. Hearing aids are only fitted when there is no available medical treatment or surgical procedure to correct the hearing loss. And the cost of hearing aids is much less than the cost of surgery.