The septum separates the right and left sides of the heart, preventing oxygen-rich and oxygen-poor blood from mixing.