The French microbiologist Louis Pasteur discovered in 1860s that thermal treatment can effectively eliminate microbes in food. The pasteurization process is thus named in his honor. Interestingly, the boiling of canned food to prevent spoilage predates Pasteur's discovery by 50 years.
Clostridium botulinum is the bacterium responsible for foodborne botulism by producing botulinum toxin. Although the toxin can be detoxified by cooking at 100 degree Celsius for 10 minutes, its spore is heat resistant and needs to be in a higher temperature to kill. If left unchecked, the spore would germinate and produce toxin. Commercially canned food is required to be cooked at 121 degree Celsius for 3 minutes in a pressure cooker in order to kill the spores. However, there are still cases of food poisoning, about 15% of total cases in US.
If you are going to can them yourself, make sure you have some autoclave tape to indicate that the pressure cooker has indeed reached the intended temperature. C. botulinum does not thrive in high acidity, high sugar, high oxygen, low moisture, or low temperature environment. It would help if the canned food has any of the above attributes.