If you have a large tree in your yard, you might look at it as a potential base for a hammock, treehouse, birdhouse, or more. It's not unusual to find these items attached to the tree, but the nails and screws required by these things often seem unhealthy for the tree. That's not always the case, but before you start adding things to the tree with hardware, consider how the hardware would affect not just the tree, but anyone working with the tree after it's dead.
No Harm Done
Usually, nails and screws don't really harm trees. Even though the hardware creates a puncture wound, your typical nail or screw isn't going to do much else to healthy, strong trees. Younger trees, though, could be in trouble just because the nail or screw would penetrate further into the tree (because of the tree's smaller diameter). And of course, if the tree is diseased or dying, the nail could contribute to the tree's weakened state. So as long as the tree is healthy, strong, and older, a nail or screw would not be a problem in and of itself.
However, what you're attaching with the hardware could create a problem. Heavy items can pull the nail or screw down, and that means the wound just above the hardware would be open to the environment, which makes it very susceptible to diseases and pests. So if you want to attach something heavy, then that might be a bad idea because the weight would cause the nails to further dig through the tree's exterior.
Is This Really Necessary?
Always ask yourself if using the hardware is necessary. For example, if you want to hang a birdhouse on a tree, ask yourself if you could possibly place the house on top of a pole stuck in the lawn instead.
The Tree's Afterlife
If the tree is nearing the end of its lifespan, it could become good material for woodworkers. However, there is a problem if there are nails in the tree. Many times the tree will heal the wound around the nail or screw and sometimes envelope the hardware in successive layers of bark. If an arborist cuts the tree down and gives the wood to a woodworker, that worker's tools risk hitting the metal hardware as the worker tries to cut through the tree. That can create sparks and damage the equipment, not to mention send parts of the tree and the tools flying.
So, if possible, avoid using nails and screws if you think one day the tree will be given to woodworkers, and avoid the hardware if you don't really need to attach something directly to the tree. If you still want more advice, talk to a tree services company.