It could well be one, the other or degrees of either.
I don't actually think "the" answer is easily boiled down into just one or two behavioral traits, inclinations or motivations. I think it's a combination of things pertaining to one's perceptions about oneself as go inferiority/superiority, loneliness, achievement/lack of achievement -- particularly with regard to one's own awareness of what potential for it they had, how much of it they used and how much they wasted, and competitiveness. I think they are all interrelated in everyone, but for folks who "lash out" as "troll," there's some sort of shift to make up for the negatives -- things they know they didn't do that they could have done or should have done differently -- in order to recover some measure of regard for themselves.
Because of the complexity of the matter, I think you may be better off reading multiple documents, at least one each that addresses the root psychological "problem"/inspiration and then aim to aggregate the ideas found there into to a coherent extrapolation/application to the specific matter of online boorishness. The content you find here may help:
This may also be useful (is this one of the papers referenced in your OP links/articles? I don't know.):
The Psychology of Trolling and Lurking: The Role of Defriending and Gamification for Increasing Participation in Online Communities Using Seductive Narratives. Be sure to check the reference list at the end of the paper; it will without doubt point you toward other highly credible sources of information on the same or closely related topics.
FWIW, I would have looked through several references/papers to see what I can learn about the psychology of "trolls," but quite frankly, the "ignore" feature is my solution for dealing with them on the Internet, and I'm content with that as my sole means of recourse. My "real world" life rarely puts me in contact with "trolls." I can't even recall the last time it did. The "real world" and the people I know/interact with in it matter to me; what goes on on the WWW by and large does not. That's why the "ignore" feature is all I need and why I don't care about obtaining something of a keen understanding of the psychology of "trollism."