In the wild, Whirlwind blows the target Pokémon away if they are of a lower level, and the battle ends.
In trainer battles (including linked battles), Whirlwind forces the target to switch out of battle (regardless of level) and is replaced with another Pokémon in the trainer's team.