I used to think this was weird, too. Especially with most modern cans of catfood that have the pull tops, how do cats know that the can opener opens good things like tuna and catfood? Because you’re right, they almost always come running, even if they aren’t fed like this.
But the more I thought about it, the more I realized that it is our association and a bit of confirmation bias at work here. We notice when cats come running to the sound of a can opener because we attribute that to cats wanting tuna or catfood. But cats also come running when we are doing almost any extended task in the kitchen, we just notice that less because the other tasks might not have a direct link to catfood.
So really, it’s not so much the can opener but the kitchen, or sounds of any human food preparation that cats instinctually respond to. However, opening a can also releases an immediate scent of food that cats can smell from a surprisingly far distance.
And how many generations has it taken for cats to know that when a human is preparing food that they should make themselves accessible for handouts? Well, that goes back at least to the days of Egyptian Pharaohs when cats learned this and decided to domesticate themselves— they have been benefitting from our food (and the rodents our food attracts) for so long, it truly is second nature for cats to come running to our food source.