The heart is divided into four chambers to keep oxygenated and deoxygenated blood separate. The right side of the heart receives deoxygenated blood from the body and pumps it to the lungs, while the left side receives oxygenated blood from the lungs and pumps it out to the body. Valves between the chambers prevent backflow of blood.