When done properly, home canned food is safe for consumption for years. However, it isn't a foolproof process. Sometimes seals come unsealed due to small bits of food on the jar rim, improper cooling times before removing from the canner, getting knocked around on pantry shelves, and sometimes the pantry goblin buggers it up just for giggles.
I've personally home canned thousands of jars and for the most part had great success. But alas, I'm not perfect. For whatever reason, sometimes jars just become unsealed...I usually blame the pantry goblin, but that's another story.
There are 3 things you should do when opening home canned food to prepare...
1 - look at it before you open it. If you see discoloration or even something that looks like mold, then discard it.
2 - listen as you open. You should hear a sucking sound as air rushes INTO the jar. If you don't hear that sound, toss the contents and reach for another jar.
3 - Smell it. Does it smell like the contents should? If you get an off smell (or even a gag reflex) flush it!
Realize that no one is perfect, and that includes me! It's happened before and let me tell you, one can usually spot spoiled food from home canning without questioning it, but the golden rule applies...
If in doubt, throw it out!