because soil and rocks are porous
Water infiltrates the ground because soil and rock are porous. Between the grains are pores, or tiny holes. Since water can move through this rock it is permeable. Eventually, the water reaches a layer of rock that is not porous and so is impermeable. Water stops moving downward when it reaches this layer of rock.