About 8 years ago when my daughter was 6, I was informed that I needed to construct a tree house.
A suitable grove of trees near our house seamed to be the perfect spot. Armed with some scrap wood a hammer and some nails I threw myself into the task. I know, I know, mom always told me "don't hammer nails into trees" but that was before Dr. Alex Shigo discovered the CODIT response. CODIT stands for "compartmentalization of decay in trees". Trees will produce a chemical barrier to stop the spread of decay. That is why inert items that enter a tree are easily dealt with and seldom pose a problem to a healthy tree.
I simply nailed short pieces of 2x4 onto the trees to hold the poles that were the frame for the floor. Now the trees of course continued to grow.
According to one study, tree roots will generate about 75 pounds per square inch. I am assuming that trunks also generate this kind of pressure. The photo illustrates how the 2x4 is being pushed away while the nails are held in place resulting in a situation where eventually the 2x4 will be pushed out while the nails are pulled through. Notice how deep the nail heads are.