Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.
It depends on the pokemon's choice.
They go to lavander town or another spirtual place near.
Then they decide what road to take.
The road to eternal peace. (poke heven)
The Road of trial. (poke hell)
The road of unfinished buisness. (comes back as sprit)
Or the road of rebirth. (reborn as a egg)
For the opening i think the pokeball opens before it hits anything unless there is somthing inside.
And in response to the why it flys back ether recoil or magic sky beings.