It was just the animations to show fainting. It was simple and never really questioned. People simply assumed it fainted to the ground and was returned into it's Pokeball. Before the XY Gen of Animation-controlled gameplay of epicness (apparently), animations weren't the important part of the game. It's a game about super animals breathing fire and shooting bolts, who cares about realism?