The heart is a muscular organ that contains chambers (right atrium and right ventricle and left atrium and right ventricle) through which blood passes. The blood enters the heart in the atria, goes to the ventricles and then leaves the organ.
The blood is pumped out of the heart by the contraction of the muscle fibers that form the ventricular walls. The contraction reduces the ventricle volume thus increasing the internal pressure and the blood then flows to the exit vessels (pulmonary artery for the right ventricle and aorta for the left ventricle). When ventricular muscle fibers distend the ventricles regain their original size and receive new blood flow coming from the atria.