It's simple. The sponge cake starts to cook first. This makes a layer filled with tiny pockets of "air" (it's really carbon dioxide, but never mind that). Any gas is a really good insulator, so the heat cannot get to the ice cream. If you are interested, the great scientist Nikolas Kurti used to demonstrate an "Inside-Out baked Alaska". He encased the sponge mixture in the ice cream and cooked it in a microwave oven. Since microwave ovens cook from the inside out (to a certain extent) the sponge cooked inside the ice cream and the ice cream did not melt. I have only heard of this and cannot vouch for its performance.