On the consolidation and erosion of cohesive sediments