Trolling is a complex subject now under serious study in science fields (e.g. sociology, psychology, social networking, etc.), but arguably it is not new behavior. Something like it has probably existed as long as humans have, even though the term "trolling" seems to originate in cyberspace. Wikipedia etymology indicates it significantly predates cyberspace. Imagine comments or cartoons left on a public bulletin board, or even graffiti could be seen as a form/type of "trolling". Anonymity/pseudonymity certainly relate to it (possibly increasing it), but of course it happens even with full identification.
Certainly cyberspace seems to possess aspects that can amplify the behavior. However, people sometimes just use the word "troll" as a derogatory epithet against people they merely don't like/disagree with, or e.g. those who are sarcastic with genuine but controversial views, so it can sometimes be really difficult to classify objectively. Somewhat like other terms such as "stalker", "sexual harassment", "sexual offender" etc., it's a "hot button" term with definition that can apparently shift significantly depending on context, and that carries high charge in cyberspace & modern era. It also ties in with an increase in social awareness/sensitivity of bullying. It also has connections to gossip.
Just ran across this new scientific paper (Feb. 2014) apparently getting major media coverage that states it's correlated with what is known as the so-called "dark tetrad" of character features.
Trolls just want to have fun. Journal of Personality and Individual Differences, Erin E. Buckels, Paul D. Trapnell, Delroy L. Paulhus:
In two online studies (total $N = 1215$), respondents completed personality inventories and a survey of their Internet commenting styles. Overall, strong positive associations emerged among online commenting frequency, trolling enjoyment, and troll identity, pointing to a common construct underlying the measures. Both studies revealed similar patterns of relations between trolling and the Dark Tetrad of personality: trolling correlated positively with sadism, psychopathy, and Machiavellianism, using both enjoyment ratings and identity scores. Of all personality measures, sadism showed the most robust associations with trolling and, importantly, the relationship was specific to trolling behavior. Enjoyment of other online activities, such as chatting and debating, was unrelated to sadism. Thus cyber-trolling appears to be an Internet manifestation of everyday sadism.