Why a hydrogel swells

The dashed midline is the gel boundary: fixed –COO⁻ charges (red spheres, trapped inside) cannot cross, so water (blue) keeps diffusing in until osmotic pressure balances the elastic network.