I guess it's because marshlands will temporarily store water and then slowly release it so that there won't be too much water at once in a nearby town. Also, this isn't the kind of place to ask science questions.
marshlands prevent flooding in a nearby town by soaking up the water from the flood and the water flows underground so that the water doesn't reach the nearby town