He needed to jumpstart her heart; Hermione had assured him that Muggles used electricity to resuscitate someone. But Muggle technology did not work here, so they had to improvise. They had adapted the reviving spell to include a pulse of lightning, in hopes it would mimic the Muggle devices, electroshocking her heart back to life. 