A heart attack occurs when blood flow to the heart is blocked, leading to damage or death of heart muscle tissue.