It’s not that cats’ stomachs are sensitive per se. It’s that the bacteria population in their intestines naturally adapts to their diet, and if you introduce a new food they’re not ready for, it will usually result in diarrhea. This is only really a problem with pets that eat the same food at every meal, and it can be solved by slowly changing their diet to give the bacteria time to adapt.
Notably, while the types of bacteria that can digest the new food are rapidly multiplying, the types that can digest the old food will be starving to death. The cat can’t retain its ability to digest the food you gave it several years ago because those bacteria are all long dead now.
A cat used to a more varied diet (such as a stray or feral cat) will naturally have a more diverse population of bacteria that can easily handle whatever food the cat happens to find for each meal. None of the different types of bacteria ever die out because they all occasionally get food they can digest.