Iron is a powerful electron donor, in wooden ships (commonly made with oak components) this same phenomenon is called "nail sick" or "iron sickness" and is why brass and bronze are preferred to iron/steel/stainless steel hardware and fasteners.
It will also do this to wood on the outside of your house if it comes into contact with moisture. The wood looks burned around old nails, because the process is similar to what happens when the wood is actually on fire.
I've been repairing the old growth wood trim on my house from the 1930's and dutchman-ing the destroyed bits around fasteners with salvaged wood of a similar age.