Pinholing (aka pitting) is the appearance of small holes or corroded areas on the undersides of the metal lids of your home canned foods.
This does not mean that the food in the jar has gone unsafe. In fact, the food in the jar will still be safe unless the holes have gone clean through the lid.
What causes pinholing?
Angela Fraser from Clemson University explains:
The underside of a canning lid is coated with enamel. If there are imperfections, such as tiny scratches or pinholes in the enamel, natural compounds in food can react with the metal in the lid to form harmless brown or black deposits.  Fraser, Angela. Associate Professor/Food Safety Education Specialist. How Canning Preserves Food. Clemson University, Clemson, SC. Accessed March 2015 http://www.foodsafetysite.com/consumers/resources/canning.html.
Pinholing may also be caused by too little headspace, letting acidic food come in very close contact with the lid underside above it:
….when very acid foods remain in contact with the underside of the lid, pinholing or corrosion might be the result. A jar with absolutely no headspace, or an extremely small headspace compared to recommended allowances (see below), may [Ed: be subject to this.]” Elizabeth L. Andress and Allison M. Oesterle. Judging Home Preserved Foods. Georgia: National Center for Home Food Preservation. 2003. Page 13.
The University of Missouri Extension says,
The underside of metal lids is protected by an enamel coating. If there are any imperfections in the enamel (for example, tiny scratches or pinholes) natural compounds in food can react with the metal in the lid to form brown or black deposits.”  Willenberg, Barbara. Food Safety. University of Missouri Extension. 5 May 2009. Accessed July 2016.
Note: Tattler Lids are unaffected by the pinholing issue as they are not made of metal.
Pinholding can occur even with non-acid foods. Here’s an example that occurred in a jar of pressure-canned rutabaga, which is a low-acid food.
Salmon and rhubarb are two particular problem foods for pinholing
The acid in rhubarb is particular aggressive and known for causing pinholes, and is a issue even in the commercial canning world
Rhubarb….. The product is very acid and contains oxalic acid, especially in the leaves. This acid is particular active in its attack on cans, causing pinholing.”  Featherstone, Susan. A Complete Course in Canning and Related Processes: Volume 3. Cambridge, England. Woodhead Publishing. 2014. Page 74.
The University of Alaska deals a lot with home canning of fish, and notes that pinholing can particularly occur with salmon:
The black spots found on the underside of the lid from home canned salmon ….. result from the interaction between the food (fish) and the containers (metal in the cans or metal in lids of glass jars). These are black iron sulfide deposits that are caused by the high processing (canning) temperatures breaking up the sulfur compounds in the fish proteins, which then combine with iron. The deposits are more commonly found in the head-space of cans or jars, but can become mixed in with the product as well.
Cans are now coated with an enamel lining that prevents much of this interaction from happening. But, the enamel lining formula was changed in the past few years and there has been a significant increase in the reports of sulfide deposits in fish products, as well as other products that use these type of enamel coated cans.
Evidently, the new enamel formula “pits” more frequently, causing microscopic breaks in the enamel on the can. The tin exposed from these breaks reacts to the salmon causing iron sulfite to form and deposit on the lid, can sides and fish that lies next to the lid and can sides. These microscopic breaks or pits are a defect in the can.
The black sulfide deposits are not harmful; they are just unattractive. The salmon is safe to eat. The recommendation is to eat all the canned salmon within a year of canning. Do not try to store the salmon for years because the can will continue to break down over extended storage. Eventually tiny pinholes will form in the can and cause the can to lose its vacuum seal.
The iron sulfite is easy to rub off in the early stages but over a longer time the iron sulfite builds up into large crystals that are hard to remove.”  Johnson, Marci. Food Preservation. University of Alaska Fairbanks. Cooperative Extension Service. Record #92 in: Food Preservation. Accessed July 2016 at https://uafanswers.com/detail.php?id=92.
Elizabeth Andress from the National Center for Home Food Preservation points out that a similar occurrence is staining of the lid’s underside:
A small amount of staining may be acceptable, particularly in tomatoes, berries and other highly colored foods. These stains should be completely on the surface of the enamel, and not signs of something actually eating away the enamel.”  Elizabeth L. Andress and Allison M. Oesterle. Judging Home Preserved Foods. Georgia: National Center for Home Food Preservation. 2003. Page 12.
Is food from a jar with a pinholed lid safe to eat?
Angela Fraser from Clemson University says:
Black deposits on the underside of a lid are not a sign of spoilage.”  Fraser, Angela. Associate Professor/Food Safety Education Specialist. How Canning Preserves Food. Clemson University, Clemson, SC. Accessed March 2015 http://www.foodsafetysite.com/consumers/resources/canning.html.
The University of Missouri Extension says,
Brown or black deposits on the under side of metal lids are harmless…. The food may be eaten as long as there are no signs of spoilage evident.”  Willenberg, Barbara. Food Safety. University of Missouri Extension. 5 May 2009. Accessed July 2016.
When is too much pinholing?
The University of Missouri says,
Caution: If there are holes through the lid, the food must be discarded so that it cannot be eaten by humans or animals.”  Willenberg, Barbara. Food Safety. University of Missouri Extension. 5 May 2009. Accessed July 2016.
The University of Maine says,
If very acidic foods (pickled or fermented products, and some juices) were kept for a long time, the acid may have eaten away at the lid, resulting in pinholes that allowed microorganisms to get into the jar. Discard any home-canned food with damaged or flaking metal on the lid.”  El-Begearmi, Mahmoud. University of Maine. Bulletin #4277, Can Home-Canned Food Spoil? Revised 2011. Accessed July 2016.
Elizabeth Andress from the National Center for Home Food Preservation says,
Any deposits that do not match the food in the jar, that appear to be building up on the surface of the enamel, or that trail from the lid down onto the food surface are undesirable and could be signs of spoilage.”  Elizabeth L. Andress and Allison M. Oesterle. Judging Home Preserved Foods. Georgia: National Center for Home Food Preservation. 2003. Page 12.