Mangroves work against coastal erosion because their tangled roots and trunks absorb the energy of tidal currents and storm-driven wind.