Slang is a complex area of language.
For one thing it changes very quickly. Another is that slang is rarely used across society (certainly not for long). Some terms may mean one thing to some groups but the opposite or something completely different for another group. Lastly, slang is often used to alter power relationships.
The BBC recently wrote about regional differences in teenage slang. Why is teenage slang so rich? Typical teenagers are struggling to define themselves as individuals in a society that still tends to see them as a single block, and a block of children. Slang can be used as a means of preventing or at least deterring comprehension of people outside what could be termed an in group. Groups of teens often feel the need for in group identification, hence slang, and many of their fashion choices.
The same thing happens in many of our classes, groups of students from one country (or linguistic heritage) tend to use their own language outside of class and class activities, sometimes in class and even to achieve class goals. A lot of this is probably sub-conscious it feels very weird to try to operate in a learner language with someone who speaks the same mother tongue as you. If both parties realise the conversation can be conducted more quickly, effectively and easily in language x then they tend to use that language as opposed to language y which might slow things down, impede communication or otherwise muck things up. Of course they might be talking about the other people in the class behind their backs, (at least linguistically).