The heart muscle is myogenic and initiates a heartbeat through an electrical conduction system; both the sinoatrial node and atrio-ventricular node are essential in this mechanism.
The sinoatrial node (SAN) is a region of cardiac fibres located in the right atrium. The electrical wave of stimulation is initiated here and extends over the two atria, causing them to contract. It is often referred to as the pacemaker of the heart.
The atrioventricular node is a region of cardiac fibres located between the two atria. The electrical stimulation, initiated in the SAN, is transferred through this region to the ventricles.
(The excitation then passes down the Bundle of His, into branching Purkinje fibres, before reaching the ventricle walls and causing them to contract)