How does the function of the cell wall help plants survive in extremely wet and dry conditions?

the cell wall provides protection to the plant cell, helps maintain the cell shape, and prevents excessive intake of water.