They are so necessary to the growth of a mangrove forest because they recycle most of the energy by eating the dead leaves of the mangrove trees. Another reason why they are useful to a mangrove forest is that their feces is the base of the coprophagous food chain contributing to the mangrove secondary production.
Digging helps the mangrove community by recycling material from deep in the mud, loosening the mud and allowing air and oxygenated water to penetrate the otherwise oxygen-poor soil.