Thoracic pump theory
CPR performed in patients over 7 kg positioned in dorsal recumbency likely uses the thoracic pump theory which says that when the chest is compressed, the heart underneath the chest wall is not directly compressed but rather the chest compression is causing an increase in intrathoracic pressure. The increase in intrathoracic pressure collapses veins, prevents retrograde blood flow back towards the abdomen and compresses arteries which pushes blood forward towards the heart and brain. The heart is just acting as a passive conduit and doesn't change shape very much at all.