Suppose the heat of the charcoal hits the foil-wrapped corn. This is primarily radiant energy from burning coal. Conducting electrons in metals are mobile and when exposed to an oscillating field of electromagnetic radiation, the electrons respond by inducing a current that counteracts the field, which is reflected by the wave principle and cannot penetrate the metal.
What's the scientific reason for this? Glass is a good insulator because of its irregular arrangement of atoms. When atomic nuclei vibrate in place, waves of motion propagate through the solid. Asymmetric vibrational modes (anharmonic potential) cause scattering of waves, thereby limiting the propagation of more regular vibrational modes. Salt on the grill will heat up quickly, but nothing can compare to how quickly your girlfriend's diamond ring reaches ambient temperature. Metal electrons "stack" on energy levels, not allowing two electrons due to the Pauli Exclusion Principle. have the same energy. So, metals have very high energy excited states, and in fact, if you heat a metal in a vacuum and apply a voltage, you basically create an electron gun. This is the basis of electron tubes and X-ray machines.

Therefore, your foil will also conduct heat due to its delocalized and energized long-distance energy transfer. This means that the aluminum foil will reflect radiant heat but transmit contact heat. This also means that hot metal surfaces can easily radiate energy. So foil does two functions, it protects cold food from incoming radiation and you can bake foil wrapped corn in hot coals because the heat comes from the glowing embers as radiation. But when you remove it from the coals, the foil cools the surface through conduction and radiation. However, releasing steam and water vapor is a cooling process, (more scientific here, the greater entropy of the steam will draw away the heat. Entropy here is the freedom of motion, the gas can move independently in 3D, taking away the heat away from the corn cooler of kinetic energy) so hot that the corn will stay hot longer if wrapped in foil.


