In some real backcountry bear attack stories, the bear's behavior also depends on the type of bear. Black bears are generally less aggressive compared to grizzly bears. However, if a black bear has had previous negative encounters with humans or is in a state of extreme hunger, it can still attack. For instance, there was a story where a black bear that had been having trouble finding food in a drought - stricken area attacked a camper who was cooking near his tent. The camper made the mistake of not realizing the bear was in a desperate situation and didn't take enough precautions.
Surprising a bear is a common cause. If a bear is startled by a human suddenly appearing in its territory, like near its den or while it's feeding, it may attack. Also, getting between a mother bear and her cubs is a very dangerous situation that can result in an attack. For example, in many backcountry bear attack stories, hikers unknowingly got too close to a mother with cubs and faced the bear's wrath.
Sure. There was a story where a hiker was in the backcountry. A bear suddenly emerged from the bushes. The hiker tried to slowly back away but the bear charged. The hiker dropped to the ground and played dead. After a while, the bear lost interest and left.