Many are easy to spot, as are posters returning under another name. As GSM says, there are linguistic tics that give people away, and although some trolls are newbies just along for the ride, most have axes to grind and have been here before.
It's not magic. We all have favourite authors based on style, and most teachers could tell if one pupil had written another's essay. This is the same sort of thing - it's just recognising patterns.
As for why people do it, I agree that usually it's not kids. I know someone once who was a nasty troll (not on here). I thought she was a friend and always defended her when others started to suspect, but she caused no end of heartache on a site I used to admin and I keep a wide berth now. With hindsight, clearly she had a personality disorder of the type that makes people think they are cleverer than others. She would post something friendly and chatty, and enjoyed getting responses from people who knew her as her usual self, as it showed that they had been fooled by her aliases and in her head that meant that she was smarter than they were. That was step one. Then the posts would get more personal, using information she knew about others (their relationships, job details, that sort of thing) and she would keep stirring, using the personal information to be hurtful, and turning one poster against another until people snapped and left or even got banned for making nasty posts in retaliation. She had multiple IDs and used them to befriend regular posters who were also taken in by her, and inadvertently backed her up in her different guises.
It blew up for her when she started PMing and emailing people pretending to be others on the forum and Admin could tell. She was banned, but persisted in trying to re-register, getting nastier each time. It ended with an IP ban, although she tried to get around that, but Admin was persistent and blocked her on every attempt, and that either limited her options to the point where it wasn't worth trying, or she gave up.
People say that the Internet is full of weirdos, and whereas I find that the vast majority of posters are as 'normal' as any of us can be, it is true that there are some seriously disturbed people out there, who get their kicks from seeing others fall out and hurt one another.