When the output of of an amplifier can re-enter the amplifier's input, then an endless loop is created and the output is re-amplified, and output again in its new, louder form ... only to be input again ... and so on.
This normally causes (and is sometimes referred to as) whistling or squealing. It's the same effect you've frequently heard if a performer with a microphone has their amplifier turned up too much and gets (with their microphone too near the speakers.
Feedback is fairly common in hearing aids, since the gain of the aid is so great and since the speaker can be so close to the microphone, because the aid is small.
If the hearing aid wearer can hear the frequency being generated as feedback, then the problem can sometimes be solved by turning down the volume of the aid, and the impact is minor. If, however, the hearing aid wearer cannot hear that frequency, then the problem can be much more serious, since other people nearby with better hearing will certainly find the feedback annoying.
Feedback may be caused if the aid or ear mold doesn't fit tightly in the ear or if the vent is too large for the amount of gain.
Feedback may also be caused by wax buildup, by a crack or leak in the tubing, or by putting something that reflects the sound (from the aid back into its own microphone) up close to your ear.
With older aids, there was little that could be done except to reduce the gain, or vent size, or to try to get a better seal on the ear mold. Some newer digital hearing aids offer processing which can detect and eliminate feedback when it occurs.