Not all sweets expand in a vacuum – it's the small bubbles of air trapped inside the marshmallows that make them react so amazingly.
The air bubbles in the marshmallows are at atmospheric pressure – this is the pressure caused by the weight of our atmosphere pressing on us. Sucking the air out of the container means that the air bubbles trapped inside the marshmallows are at a much higher pressure than the remaining air surrounding them. The trapped bubbles expand, causing the marshmallows to expand.
When air is let back into the container, the surrounding air pressure increases again, and the marshmallows deflate back to their normal size.
At sea level we all experience atmospheric pressure, but we don't really notice it as we are used to it. But as you start to climb in altitude, the weight of the air pressing on our bodies becomes less and popping ears is one way we feel the change.
Our bodies can cope with slight changes in pressure, but in extreme cases, such as in space where there is no atmosphere, our bodies need a bit of help. Space suits are designed to exert a pressure on astronauts' bodies that mimics that of Earth's atmospheric pressure. Without it small pockets of air trapped inside the astronaut's body would start expanding just like our marshmallows – which wouldn't be a pretty sight!
Find out how to perform this and many other tricks with Physics to Go.
Try a new trick each month with our intrepid cat and dog team - Marvin and Milo.