I used to be good friends with several moshers, back when I lived on the East Coast. I'm talking about "true" moshers, those who mosh as a legitimate dance to express how much they're enjoying the music - not posers who mosh to act out their violent urges or just to simply be an ass. There's a big difference, and I feel I need to stand up for the true moshers before they get ridiculed along with the jerks.
Moshing is typically done to "hardcore" music, a blend of punk and metal that started in New York City and Washington DC. (Those are just US origins; the style may have arisen independently in other countries as well.) The grandddaddy of the genre is Bad Brains; the most famous hardcore band is Suicidal Tendencies.
When a mosher goes to a hardcore show, they want to physically enjoy the music in the same way that a metalhead might band their head at a Maiden show. They are of the opinion that any "stationary" dance doesn't adequately express their love of the music and the energy they get from it. So they throw their entire body around - a whole crowd of moshers doing this at once leads to inevitable collisions, and thus slamdancing was born.
True moshers are a brotherhood. When slamming, they are careful with their hands, feet, elbows and knees and try not to hurt anyone else. They view slamming as an aggressive equivalent of a high five or a friendly slap on the back. This is why they catch the stage-divers (an activity which is encouraged at some club shows, though it's frowned upon more these days than it was in the 80's). This is also why they pick up the fallen right away - they don't want anyone to get hurt, that's not the point of slamming.
True moshers also look out for the "moshing-impaired". People who are trying to mosh safely but aren't good at it are usually kept at the edges of the mosh pit by their more experienced friends, so that they can escape if the going gets rough. Only a self-destructive fool goes into the center of a mosh pit on their first try!
Of course, there are idiots from outside the mosher community who only see the slamming and don't know the etiquette. They think it's all about violence, and so they act that way. I've seen some of these fools actually go into a mosh pit and start throwing punches around. The true moshers will invariably push these idiots out of the pit with well-placed slams, and confront them peacefully when the show is over.
In other words, don't look down on moshers as a group. You still have to judge them as individuals, and most of these individuals that I've known have been intelligent, decent people who just have an unusual way of having some fun at a show.