Smeargle is out first to stall, and then boost your stats ridiculously high through shell smash that gives it ridiculous attack, special attack and speed, defense is not important. When it get's attacked it instantly dies, but it has an item (focus sash) that makes it survive, he uses the move baton pass that switches smeargle out for magikarp, and keeps all the stat bonuses active, then magikarp is one-hitted, but also has focus sash so he survives.
Magikarp has an attack called flail, it's an attack that deals more damage the less HP the user has, and since magikarp is at 1 hp it has a ludicrous 200 attack power, combined with unbeatable speed and boosted attack stats he can one-shot any pokemon that doesn't have focus sash or other protection (ghost type, etc).