>There are obstacles such as a Poison Gas cloud, electricity, flames, vines, and bewitching mist that block the locked doors and certain pathways in dungeons. If a Pokémon of the type of obstacle is brought along with the player's Pokémon, the obstacle will disappear when the playable Pokémon touches it. Water-type Pokémon can eliminate the flames, Electric-type Pokémon can get rid of the electricity, Grass-type Pokémon can get rid of the vines, Poison-type and Steel-type Pokémon can get rid of the Poison Gas cloud, Ghost-type and Dark-type Pokémon can get rid of the mist, and ice can be eliminated by Fire-type Pokémon.
Source: Bulbapedia