Something vaguely like those glow in the dark trunk lid releases, like they put in American cars. To prevent people from being trapped.
Baby Spock moved, there was pressure outside, the lid released, he crawled out.
Where did the rest of Spock's body get too? He changed from a 85 kg adult corpse, into a sub 5 kg baby. Where did the rest of him go? There should have been organic "goo" in the torpedo casing.
In one of the Incredible Hulk movies, when the Hulk change back to Banner, there was a growing puddle of fluids around his feet.