I googled this.
Bloggers answered.
===============================
How do you determine how long a can of food will last? Actually, it's kind of hard to guess, but here are a few guidelines when trying to determine the shelf life of your canned foods:
Home-canned foods Most sources say that home-canned foods will store safely for at least one year.
With other food items, the level of acid in the food is the critical element for determining how long it may store. Low-acid foods last longer on your shelves than foods with higher amounts of acid. Some sources say all commercially canned food should last at least two years. Here are some more specific recommendations:
Low-acidic foods Surprising to some, canned meats can last the longest. Most sources say they will keep for 2 to 5 years. Some sources say they will last even longer. I found a shocking story about a can of meat that was 118 years old. It was opened, analyzed, and found to still have most of the nutrients. It was still good after more than 100 years! You may not choose to eat canned meats that are this old, but likely yours will last more than the recommended five years. Other low-acid foods are soups without tomatoes, carrots, potatoes, pumpkin, and peas.
High-acidic foods For best quality, use high-acidic foods within one year or so. Foods in this category are tomatoes, fruit, and foods with a lot of vinegar in them. Still, many of these canned foods will still be edible after years worth of storage, even if they are not at the peak of quality and nutrition.
So what does it mean when we learn that something will last "at least two years?" How long will it last after the two years is over? Again, this depends on who you ask. Some people will say that you should discard the cans at this point, but most will tell you that canned foods can last for a lot longer, even years and years longer. You'll just have to use your own discretion and inspect your cans carefully before eating the food inside. Read the next article in the canned food series, "Canned Food Storage Safety" to know what to look for when inspecting cans for safety.
===============================
The dates stamped on the can are the packing date.
I take it you are speaking about canned food from the store, and NOT home canned goods.
The number of years your food is good for will vary dramatically. What types of food are you talking about?
What conditions have the food been stored in? Hot and humid or dry, dark and cool?
I have a very large pantry. We have about two years worth of food storage. We are working toward seven years worth of food storage.
Modern canned foods are very safe. Examine any old cans...any dents, rust, or bulging? Discard them.
If the can is in pristine condition (no dents, rust, or bulging), you should be able to safely eat the food for at least 10 years.
Foods that are very salty ( most condescend soups), items that have a lot of sugar (peaches in heavy syrup, or jelly), or items that are very acidic and stored in glass (pickles), may be good for 20 years or more, as long as they have not been exposed to light in the case of items in glass.
There are certain items which will never go bad. Salt, sugar, and honey will never go bad. You could store them for thousands of years, and use them safely. In the case of honey and sugar, insects might get into them, but they will never actually go rancid.
The food items that I am cautious with are canned meats, canned fish, and canned items containing meat. Those are items I do not store beyond 10 years.
===============================
Canned food is pretty safe from bacterial action. but there can be exceptions of fx production temperatures were not correct. That is usually what causes 'bulging' cans.
Canned food is not necessarily safe from chemical reactions. The metals used in the can may react with the food and contaminate it. If the can is sealed with a solder containing lead the lead could diffuse into the food and that is not healthy. cans older than about 20 years were made with metals only and should not be trusted.
Modern cans are usually made with an inner polymer lining to avoid such contamination, but even there production errors can give rips or holes in the lining so metal and food can get at each other.
And finally cans can corrode from the outside until holes appear through which bacteria and whatever can get at the food.
Heat and moisture accelerate corrosion and chemical reactions so storage in a cool dry place improve the odds of the can staying good.
You can be lucky and have a can that is still eatable after hundreds of years, but you can also be unlucky and get a can that has gone bad after a few years. maybe even before the expiration date.
So it is not true that cans 'never really go bad'. At least not without a lot of caveats: perfect production, cool dry storage, non acidic food, etc.
===============================