Non architect here, can somebody explain how this castle isn’t eroding away?

This place is called Mont-Saint-Michael in France, and I’ve become fascinated by it. Why hasn’t the water after all these years worn it away? What did they do to the walls to keep them waterproof?