To communicate. Bears also use tree scratching to communicate with one another. They can scratch trees to show their dominance, to attract mates, or to warn of danger. For example, a male bear may scratch a tree to show that he is the strongest bear in the area, and a female bear may scratch a tree to attract males.
To groom themselves. Bears also use tree scratching to groom themselves. When they rub their backs and sides against a tree, they can remove dirt, parasites, and loose fur. This helps to keep them clean and healthy.
To stretch. Tree scratching can also be a form of stretching for bears. When they reach up high to scratch a tree, they are stretching their muscles and ligaments, which can help to keep them limber and mobile.
As a warning sign. Bears will also scratch trees to warn other bears that they are in the area and to stay away. This is especially common during mating season when males are competing for mates and females are trying to protect their cubs.