Food only ferments if it wasn't processed safely, and yours was not processed safely. Please read the links I provided early if you can. Safely processed food will never ferment because it is in a completely sterile environment.
Ah. You did not safely can your food by the sounds of it. Personally I wouldn't eat them.
https://nchfp.uga.edu/publications/uga/using_bw_canners.html <--- Information about water bath canning (boiling the jars in water)
https://nchfp.uga.edu/publications/uga/using_press_canners.html <----...
How did you can them? Pressure canning or water bath? How long ago did you can them? How long did you process them?
I ask these questions because 1) it doesn't matter how you processed them, if you opened a jar immediately out of the canner, they shouldn't taste sour unless you added vinegar or...