The beating is not only changing speed, but the beating itself is becoming irregular [an arrhythmia]. The chambers of the heart need to beat with a certain speed and strength, in synch, to properly pump blood. Of course, without proper blood flow, tissue will die.
This arrhythmia is caused by cocaine increasing the amount of catecholamines [a stress response chemical] in the brain. It does this by preventing the “clean up” process after the chemical’s work has been done. The chemical then persists and continues to send its signal unnecessarily.
“The adverse effects on the heart are due to the direct actions of cocaine by inhibiting the reuptake [retrieval after transmission] of catecholamines [defined below] into the nerve endings. The increased catecholamine levels can induce life-threatening arrhythmias [an irregular heart rhythm].”
Source: https://www.ncbi.nlm.nih.gov/books/NBK430976/
“Catecholamines are important in stress responses. High levels cause high blood pressure which can lead to headaches, sweating, pounding of the heart, pain in the chest, and anxiety. Examples of catecholamines include dopamine, epinephrine (adrenaline), and norepinephrine (noradrenaline).”
Source: https://www.cancer.gov/publications/dictionaries/cancer-terms/def/catecholamine
TLDR: Cocaine prevents the cleanup of stress chemicals in the brain. The heart becomes quick and inefficient, reducing blood flow, and dies due to a lack of oxygen.