1. (noun) a type of Thai dish, also known as spicy salad: main ingredients are fish sauce, sugar, and lime (chili is optional).
2. (verb, colloquial, limited use) to mix or blend together
3. (verb, slang, limited use) to attack, usually refer to attack by a gang
The 2nd and 3rd meanings are derived from the first one. We mix all the ingredients in ยำ and therefore this definition has been referred to the action of mixing things together. For the 3rd meaning, things that have been mixed include hands and feets of the attackers.