AEDs read and analyze electrical activity from the patient's heart to detect shockable rhythms. If a shockable rhythm is present, the AED can deliver measured and carefully timed jolts of electricity to restore a normal rhythm. The process requires more hardware and software than "just some capacitors and a switch."
OK ,, you win ,, it also requires a $5 discriminator circuit..