Change your preferences here.
Enemy Pokémon cannot switch out. Pokémon can escape by using Baton Pass.
Arena Trap is almost identical, but allows Flying-type Pokémon and those with the Levitate ability to switch out.