It has the magic ablilty to detect an orc presence near it. When this presence is felt, it glows blue, as it did before the fight in the mines of Moria when the orcs attacked the Fellowship.
Gollum is afraid of Sting. This fear helped Bilbo when confronting Gollum under the mountain in The Hobbit. It also helped Frodo tame Gollum (temporarily) in The Lord of the Rings.