ECT has been construed poorly in the media, typically as abusive towards patients (or as a threat). However, it's a legitimate technique that's been proven in clinical trials repeatedly. In popular lit, you can read about the experience of going through (and receiving help from) ECT in Sylvia Plath's The Bell Jar; I've personally experienced a thorough ECT treatment, and her depiction of the relief (the titular bell jar imprisoning her/suffocating her is lifted to sweet relief).
Medically, it's introducing small (but seizure-inducing) voltages to the brain. The patient is typically given a muscle relaxant and/or a sedative for the duration of the administration. They are tied down—not to stop the patient from resisting, but to stop them from hurting themselves during the administration through involuntary muscle movements. This is repeated, multiple times in a week, for several weeks until being able to discern either a positive effect or lack thereof.
When I last researched, it was not entirely understood why this treatment provides such a fundamental relief. One theory (I tend to hold this one, as it just makes sense) is that some peoples' depression emerges from an overconnected brain, seeing patterns and associations that others do not (as easily). Under this model, the ECT severs some portion these connections and brings "quiet" to the depressed person's brain; again, this is similar to what I have personally observed in myself.
I should note, the ECT is a serious treatment with long-term neurological effects. Short-term memory loss is common, with other complications being much more rare. It should not be taken lightly as it can cause perceptible, permanent changes to the person's emotions, memory, personality, and cognitive ability, with by far the largest symptom being impairment of short-term memory.
Just in case you don't get an answer: ECT is in fact a standard medical/psychiatric treatment for certain types of psychiatric illnesses.
It gets a bad rep because of the existence of involuntary treatments. That doesn't mean that there are people that consent to it, because it can be highly beneficial to specific types of psychiatric illnesses.
As far as I've understood from a doctor friend that explained it to me, the patient is fully under narcosis and paralysed (otherwise the muscles will do all sorts of dangerous things), so they don't notice a thing, apart from probably waking up with a sore arm. This is because (I've been told) they leave one arm not paralysed for feedback and monitoring the process.
Indeed, ECT is highly misunderstood, mainly because it was misused in the 70s and the name "electro-shock therapy" as it's usually called sounds scary. It's frequently misrepresented by Hollywood too.
I know someone who had this treatment for extremely severe depression and it worked remarkably well. Short-term memory loss is a common side effect, but it doesn't last.
My graduate school research was associated with a very active bipolar disorders research group. Whenever ECT came up in casual discussion, nearly all the psychiatrists said they would personally choose ECT over medication.
I can't say I understand the diseases or symptoms that represents, but there's significant literature available for the efficacy of ECTs in relieving over-active and/or over-connected brains. Hell, one of the horror stories is in itself a success case—Sylvia Plath's The Bell Jar.