You can also freely substitute among your team of 6, though subbing replaces your attack for that turn. If you anticipate the opponent using an attack of a particular type, you can sub in something resistant to that attack.
In single-player/story mode, you never encounter an opponent at the maximum level, and the NPCs tend not to build type-diversified teams, so the player gets a huge advantage in most battles by just grinding a couple pokemon of the right type.