What is the difference between galvanic corrosion and crevice corrosion?

Galvanic corrosion occurs when two dissimilar metals are in contact with each other in the presence of an electrolyte, resulting in an electrochemical reaction that accelerates corrosion of the more reactive metal. Crevice corrosion, on the other hand, occurs when a metal is exposed to a corrosive environment in a confined space, such as a crevice or pit. In crevice corrosion, the restricted flow of oxygen and ions creates a localized environment that accelerates corrosion. While both types of corrosion involve localized corrosion, galvanic corrosion is driven by electrochemical reactions, whereas crevice corrosion is driven by environmental factors.