As to how these bears learned or acquired this knowledge, I can only speculate, be it a smart gene, Internet access or Doug Paul's evolution in action. Once there is universal use of foolproof canisters, though, this acquired skill will have no useful value to current and future generations and it will quickly be forgotten and the bears will return to their natural food sources. Devolution??
The bears can smell the food no matter how well you wrap it so they know the food is there. They apply trial and error (bite it, gnaw on it, claw it, slam it, jump on it, etc) repeatedly. If their efforts never succeed, they don't try as much. If their efforts succeed even once, they become very persistent and eventually learn specifically what they did to get the food. Mama certainly passes the skills on to the cubs and perhaps they can also learn by watching others. (The same general paradigm applies to hung food, too.)
There are several methods for extinguishing the skill. One would be for all hikers to secure their food in ways that the bear has no chance of getting it. Moms may still teach their offspring to attack canisters for a few generations, but if it stops working, the skill may eventually die out. But at least a few bears will continue to test canisters and they can always relearn the skill if given the opportunity. And, of course, getting humans to be 100% effective at protecting their food isn't very likely...
Another method would be to apply some form of aversion "therapy". If we packed some sort of poison with our food (in a way that the bear could not separate it from the food), the bear might learn that while human food smells good, it makes one sick (or dead). (For instance, bears in certain places out west have learned that rangers shoot them with rubber bullets so they run from uniformed people.) Of course, an occasional human might also eat the poison too...
A third method is "human directed evolution". If we killed any bear that touched our food (or wandered near us), eventually only bears that were afraid of anything related to humans would remain. (I have read that this is essentially what has happened in Europe.) I understand that bears in places where they are hunted similarly tend to shy away from humans.
A final method (that is in current use in some places) is to trap and transport problem bears to remote areas. This is only partly effective because the problem bears often return to the place where the problems occurred. (The bears are sometimes killed after they return some number of times. The bears also learn to stay out of traps and the method becomes less effective after several repeats.)
So there are multiple strategies for combating the problem. Unfortunately some (probably including the most effective) strategies involve harming the bear. And some of the others require 100% proper behavior of humans which isn't likely to happen.
And, of course, keeping people with food out of areas inhabited by bears would also solve the problem, but I doubt that this solution would be very popular among those who frequent this website...
Doug