How an implantable cardioverter defibrillator (ICD) works