In fact, it began as slam dancing in the punk era and grew more violent with the advent of Nirvana. (I type this while Elgar plays.) Moshing requires musicians to leap from the stage into the crush and be carried aloft by the enthusiasts. One expert, at Crowd Management Strategies, calls it "chaos with etiquette".
Said to be of obscure origin, it is probably from mash, the Old English brewing term - masche - with several Nordic parallels: mash mixes malt and water; the result, wort.Reuse content