Corrosion was a natural process that breaks down metals.
The Horta on Janus VI used a natural corrosive agent to dissolve away the metal and nearly disintegrate the automatic machinery, piece by piece, used by the miners on the planet. According to Chief engineer Vanderberg, prior to determining the cause of the corrosion, "There was no reason for it, and our chemists were unable to analyze the corrosive agent." (TOS: "The Devil in the Dark")
The schematics of the USS Voyager Quarren found in the Cyrik Ocean were severely corroded. This exacerbated mistakes in Voyager's depiction in The Voyager Encounter, which was inaccurate to begin with due to the Kyrians' warped perception of the ship and her crew. (VOY: "Living Witness")