Bears are simply unpredictable. One woman (a park ranger or something, I think) walked around the curve of a trail and came face to face with a black bear. They stopped and looked at each other, the woman frozen in place (she knew not to run). The bear walked up to her on all fours, sniffed her hand, and walked away.
I agree that most bear attacks are probably caused by surprising a bear, getting between bear and cubs or between a bear and its kill.
And it depends on how recently it ate, and how much. In spring, just out of hibernation, and they haven't eaten for a few months, all bets are off. They tend to be cranky then.
Sue