The primary function of cardiac muscle is to contract and pump blood. This process is initiated by electrical impulses generated by the sinoatrial node, often referred to as the heart's natural pacemaker. The impulses travel through the atria and ventricles, causing them to contract and relax in a coordinated manner, a process known as the cardiac cycle.