The idea behind CPR is to get oxygen into the brain by providing artificial respiration and creating bloodflow. It almost never brings someone out of cardiac arrest without assistance of a defibrillator, but it's used to maintain health of the organs after the body itself is "dead".