I've seen this on a documentary. It all has to do with the way the person walks. According to the show, there is a thin layer of cool ash over the hot coals and if the person walks gently and quickly, that layer protects their feet from the heat. Am I going to test that theory? Not on your life!
physics. severity of burns is determined by 3 things. temperature, duration, and pressure. when you walk on hot coals or what have you, the idea is to tread lightly at a steady pace. dont run or you put too much pressure and get burned. and stop or you increase the duration and get burned.
I think it's mostly physics and some faith to give one the confidence to focus less on fears of getting burned as they get through the exercise and make it to the end. Mind-over-matter, in my opinion is a successful combination of physics and faith.