Here's why:
* Mid-ocean ridges are divergent plate boundaries. At these boundaries, tectonic plates move apart, creating space.
* Magma rises from the mantle. The space created allows magma from the Earth's mantle to rise and erupt, forming new oceanic crust.
* The process is continuous. As the plates continue to move apart, more magma rises and solidifies, pushing the older oceanic crust further away from the ridge.
So, the oceanic crust is constantly being generated at mid-ocean ridges and then moves away from them, eventually being subducted beneath continental crust.