The electrical current is produced in the SA node (the primary pacemaker of the heart) and travels to the AV node via fibres in the walls of the atria. These impulses cause the muscular walls of the atria to contract, forcing blood through the atrioventricular valves and into the ventricles. There is a layer of non conductive tissue between the atria and ventricles that causes a delay in the conduction of electrical current. This delay ensures there is enough time for all of the blood to be pumped from the atria into the ventricles before the ventricles start to contract. The current then travels from the AV node through the bundle of His and purkinje fibres which deliver the current to the muscular walls of the ventricles, causing the ventricles to contract. This structure allows the heart to beat from the apex (bottom) upwards, to ensure all the blood is pumped out of the ventricles, through the semilunar valves and into arteries (this is analogous to squeezing toothpaste out of a bottle - if you squeeze from the bottom up to the top you can get it all out).