The grain contains water, both in free form and trappedas starch. When you heat it the water expands to steam, building up pressure until the corn explodes. The structure becomes stable because of the dried out carbohydrate and protein left behind. It collapses again when damp.