Blood flows according to pressure gradients— it moves from regions that are higher in pressure to regions that are lower in pressure. Accordingly, when the heart chambers are relaxed (diastole, A), blood will flow into the atria from the veins and from the atria into the ventricles along the pressure gradient.
At the start of ventricular systole (B) , the pressure rises in the ventricle, closing the atrioventricular valves. Pressure continues to increase in the ventricle as it contracts, and eventually the pressure will surpass the pressure in the arteries. The pulmonary and aortic semilunar valves will open and blood will be ejected into the pulmonary artery from the right ventricle and into the aorta from the left ventricle.
As the blood leaves the ventricle, the pressure within the ventricle decreases. Once the pressure in the arteries is higher than that in the ventricles, the aortic and pulmonary semilunar valves will close. Although ventricular pressures continues to decrease, volumes do not change because all valves are closed.
Once the pressure is again lower in the ventricles than in the atria, the atrioventricular valves will open and blood will again enter the ventricle from the atria. Once the ventricles are completely relaxed, their pressures will slowly rise as they fill with blood from the atria.