This is due to gravity. The Earth's mass is concentrated at its center, and the force of gravity pulls everything towards that center.