Same with (bottled) water. The same water that was around even before dinosaurs digested it, also has an expiration date. I assume it has to do with law: everything considered to be a food has to have an expiration date printed on it, no matter how ridiculous it seems.
This can of pineapple slices has been found in the back of the food cabinet in December 2020. Its expiration date was in July 2017. I did not open it. I carefully removed the can outside right into the trash bin. I didi’t want to risk an explosion of this fruit bomb.