Those who have the most money often also have the majority of the power in the world. The wealthy have the power to pay for lobbying for their goals, or even bribe to get their way. If people are protesting an institution or business which relies on profits to further its goals, divestment is an extremely easy way to show a removal of support for that agent.
Divestment can get a company to change its policy in a hurry. The trick is to have enough people do it to create an impact. Chik-fil-a was protested and boycotted for its views, but not enough people acted, so the protest was a failure. However, divestment was effective in South Africa, as the world stopped investing in the country until it ended apartheid
Divestment basically works the same way as a boycott. If something cannot be funded, it cannot continue to operate. This is like starving someone to death, metaphorically-speaking, of course. I'm surprised it isn't used more often because of how effective it actually is, and I wish it was used more often against large corporations.
Divestment is simply to opposite of investment. So, if you find you don't like your pencil and you want to protest the company through divestment you're going to sell your pencil. I don't think that works well in most scenarios because the act doesn't really harm anyone, nor threaten them. If you were a major stock owner and you sold in protest, chances are someone else will be waiting and willing to buy those as well, so there again, not much of an effect. I think this could be successful if it was a celebrity or spokes person well known by the public and they used divestment and then asked others to do the same, but it would still be a pretty weak protest.
Divestment sounds in principle like an effective political strategy, as it denies some one or some group access to much-needed capital. However, in the long run, investors from other parts of the world will see an investment opportunity which has been left unfulfilled. Those investors will step in and provide capital, enjoying the returns.