Oxygen rich-blood from the lungs comes to the thin walled upper chamber of the heart on the left, the left atrium. The left atrium relaxes when it is collecting this blood. It then contracts while the next chamber, the left ventricle, relaxes, so that the blood is transferred to it. When the muscular left ventricle contracts in its turn, the blood is pumped out to th body. De-oxygenated blood comes from the body to the upper chamber on the right, the right atrium, as it relaxes. As the right atrium contracts, the corresponding lower chamber, the right ventricle, dilates. This transfer blood to the right ventricle, which in turn pumps it to the lungs for oxygenation.
Blood goes through the heart twice during each cycle in other vertebrates. This is known as double circulation. The separation of the right side and the left side of the heart is useful to keep oxygenated and deoxygenated blood from mixing.