Joblot:
It is pretty basic logic.
Your body produces heat which is siphoned off by the air, water, or solid you are in contact with. Water, rock, dirt, etc. have greater density than air and will siphon more heat faster. Wood has less density with some air trapped in the fibers and siphons heat from you at a slower rate. Moving air which causes faster heat loss than still air is impeded by the wood in whose cavity you have taken refuge. The tighter the fit in the tree cavity you are in, the less bodily heated air that can escape to the open air and the less energy your body needs to maintain core temperature. A cave does not wrap around you and do as good a job of radiating heat back to your body because it is larger than your body and ground or rock contact causes faster heat loss.
Bountyhunter