I’ve heard it claimed social stratification didn’t really start happening until agriculture; that’s when you see many small residential structures and a few large ones. On the other hand, it allowed for specialization and the pursuit of arts and sciences (at least for the elite).
In my limited experience of just living in bad neighborhoods, most gangs I’ve encountered are just small groups of kids that sell drugs, rob, burglarize, fight, and occasionally kill kids in other small groups. From talking to older people that were in gangs (well, they still consider themselves to be in a gang, but the gang doesn’t functionally exist or do anything), things were much different in the 80s and 90s. Guessing it differs depending on the city though (there aren’t really “territories” in my city; drugs are sold through apps/text).