@Gargron We have bears where I am, and it's really down to enticement more than anything else. You keep garbage in plastic bags inside sturdy bins, to reduce enticement and make it a hassle for them. You don't leave pet food outside at night, or more than necessary. In the dead of winter, one might take interest in food provided for birds.
Rarely, an individual bear might become a problem in a given small area, because they've overcome fear of humans or have trouble foraging or something.