On our mountain in the Okanogan Highlands, where we lived for 7 years, there would often be black bears hibernating under
trees out back on our property, and times of year when you'd potentially see scat or tracks of bears coming down to the
pond for
water. They were pretty discreet; many locals liked to hunt bear in season.
We composted using steel tumblers (the larger kind, about 2-3 feet diameter, that can get a little hotter than one-barrel tumblers for our shorter, alpine warm seasons). They were generally located at least 20-30 feet from the door of the house, to provide some maneuvering room in case we surprised a bear investigating them.
The only time I ever personally saw a bear at the bin was a triple error day: I had dumped a big bag of freeze-damaged apples (basically applesauce still in the skins), a month or so after harvest season, and left the lid open. I didn't know that Ernie had also previously dumped some stale pork chops from the fridge. You can't really blame a scent-sensitive scavenger for showing up for pork chops and applesauce. The encounter was after dark - I had to use a flashlight to see what it was. And I was able to scare it away without leaving the doorway. I think it had eaten what it wanted already, when I came out and started making spluttering upset-ape noises at it. It was just curious about my grunting and banging, but when I started scolding it in real words it seemed to realize I was serious, and backed off into the woods. (Maybe its mama warned it about humans when they heard people talking growing up ...)
I generally didn't compost meat scraps, though Ernie apparently did (from what I found while processing the compost). We both preferred to give the dogs and chickens first crack at things, to keep the attractive smells down. Our dogs were not unusually big, but we always had two at a time. Just regular sized breeds such as border collie mix, labrador, black-mouthed cur, and pit bull. Great Pyrenees are awesome guardian dogs, but a hefty feed bill if you don't need them for precious critters like kids, lambs, or children. A mid-sized dog that suits your lifestyle (good for playing with kids, hiking, or whatever) can be effective. A pair or pack of them can make enough noise to deter most predators, especially backed up by full sized adult humans who are prepared to listen for "three alarm" predator alerts. And all of these options are more effective deterrents when combined with a low return on effort (not enough food to justify repeated risks).
We did see more persistent visits from all wildlife when local creeks dried up or froze, and our pond was the biggest water source for a mile or two.
Deer, elk, moose, coyotes, coy-dogs, the occasional wolf or bear. But our bears were some of the most discreet of the bunch.
We had neighbors in that area who put out more food, like using a cooler in the creek for a "fridge," and got robbed repeatedly. They also got some great game-cam footage of a repeat-visitor bear settling down to his "picnic lunch" out of that cooler. When they stopped putting food out in easy-access containers, the bear stopped coming by.
Bears are pretty similar in tastes and calorie needs to people, though they love to enjoy food that is a lot more rotten than we can tolerate. If you wish you had eaten it before it spoiled (ice cream,
lasagna, chicken soup carcasses, eggs, etc), putting it out in easy-access piles or containers seems like a great way to develop trash bear problems. Letting the dogs and chickens have first crack at these things seems to solve multiple problems, not just bears but rats, raccoons, coyotes, etc. plus slightly reducing your feed bills.
On a visit in the Lake Tahoe area, we had much more aggressive/persistent bear encounters - a smaller bear, possibly one whose mother had been taken out of the picture recently, and/or was raised by a trash bear mother. I'm ashamed to say we contributed to its delinquency by leaving snacks in our car, not something I was super conscious about at that point on a long journey. It got into multiple cars, some due to windows rolled down, and once through an open hatchback while someone was packing for a trip. It did a fair amount of damage trying to get out of the hatchback car before the owner got brave and opened the door for it. It ran away pretty fast once it was free.
Leaving snacks/groceries in an unattended car definitely not recommended.
In places like that, where trash bears are common, they make thicker steel bins for trash, with specially designed lids - sometimes using "bear resistant" catches designed to be hard to operate with claws, since a bear is perfectly capable of learning to open an ordinary lid. I've seen folks in areas with dog pack or rat problems create steel mesh ventilated doors for the catchment areas for their composting toilets, however these seemed to be a persistent mess to deal with. And I've heard of some of the larger bears clawing right through thin sheet metal if they are motivated enough. Concrete walled structures do seem to keep most anything out, however, in case someone is super determined to turn around a trash-bear situation such as an ill-guarded local midden or dump.
If you have a trash bear problem, there is probably also a community-feeding-the-bears problem.
Vigilante attacks /shooting of bears, especially by people who don't have the knowledge or patience to ensure they are removing the correct bear and not leaving unattended cubs to turn juvenile delinquent, are not that helpful. Irresponsible human aggression can escalate the problem, as injured, irritated, or bereaved bears may become more aggressive as they persist in trash-bear lifestyle.
Problem bears can be removed by various wildlife authorities, though I sympathize with the folks living near where tagged bears may be released. Presumably the tag lets them identify repeat offenders, but I'm not sure what the
politics may be as far as when/whether to kill a repeat problem animal.
In some areas, hunters can get bear tags/licenses, and bear meat makes good sausage (especially if they've been feeding on relatively clean sources, like farm waste). If you like the idea of turning problems into ultimate solutions, you can drop a hint through local networks, and try to find a hunter skilled and responsible enough to be worth inviting onto the property.
Ernie and his dad both find black bears easier to "shoo" away than your typical stray dog. They are not that much bigger than a dog, and typically smaller than an adult person, so we're scarier to them than they are to us. Top predators usually have better things to do with their day than get in a lose-lose fight with another top predator. So you can generally bluff them into wandering off, especially with a Plan B like being able to get inside and shut the door if it turns out your particular bear is a weirdo. Be wary and report any bear that approaches or seems aggressive, as this is not normal behavior for bears.