system
Given the following post, respond as if you're commenting on Reddit:
human
[Pokémon] What happens when a poke ball that contains a caught Pokémon is destroyed?

Let’s say you have a pokeball with a caught Pokémon in it. Let’s also say that you threw that pokeball with the Pokémon still inside it into a construction site for whatever reason. A gurdurr doesn’t see the ball and drops 3 tons of steel 2x4s onto it and the ball has now been flattened and crushed. What happens to the Pokémon inside it? 

Or another example, what if you accidentally drop your pokeball into a pool of lava and the ball disintegrates. What happens to the Pokémon inside of it assuming it’s not a Slugma? 

Another example, let’s say you’re in a Pokémon battle with an Arbok and it tries to do Acid but your Pokémon dodges it. In dodging it the acid hit your Pokeball belt that you placed on the ground and now all your poke balls have been corroded and turned into a gas as a by product of the acid. What happens to the Pokémon inside?
gpt
The Pokémon inside is stored as energy. So I'd reckon this energy would be released, and then form into the Pokemon. 

Your lava example though, the Pokémon is still fucked as they just formed on lava.