Pete,
We used electric fences around our field camps for years, with food, stored and cooked within the camp. Only breach we ever had was a moose who ran through one camp in the middle of the night, being pursued by a grizzly bear. Neither the bear nor the moose were interested in us, but it made for a kinda sleepless night.
We used electric fences in a camp on Kodiak that arguably has the highest density of brown bears anywhere, at least seasonally. Again, fook, cooking, etc. All of these camps were often left unattended during the day when crews were working.
Before we adopted electric fences, we literally had bears in our camps nearly every night, and many days. We hung food up from trees, but the bears still came in.
ANYone who worked on our area out of a camp was required to use electric fencing around their camps.
These were not elaborate fences either, though if I were fencing a serious attractant, I'd use a bit more serious fence, at least two strands.
We ALWAYS used the ribbon wire, which flutters in any breeze. That flutter often gets a bear's attention, and it puts its nose on the ribbon.....bam! Trained bear.
The single biggest failure point with electric fences is getting a decent ground, which can be a bit tough, depending on soils. But, if this is a longer term (as opposed to a backpackers camp for a day) you should be able to drive in a good ground rod.'
Here's a pretty good selection and variety of fence materials:
https://www.amazon.com/s?k=electric+fen ... hzzxikn5_eBut, the short answer to your question is, yes, they work.