ECT, or Electroconvulsive Therapy, dates back to the 1930s when it was developed to induce seizures in patients with severe Schizophrenia or Depression, as it was believed that the seizures might ease the symtoms of these mental illnesses. By the 1940s the practice had become much more widely used and up to a million people per year received the treatment worldwide.
The practice was discontinued in part because it was being used rather indiscriminately at times, for illnesses and behavior disorders that really were not affected by the treatment at all, and in institutions it was sometimes used as a punishment, sparking widespread controversy.
It has come back into the treatment portfolio because new technology has made the treatment safer, less painful, and more targeted to specific areas of the brain, minimizing side effects. Still, it is used much more rarely than in the past.