Benjamin Lessing has a really interesting post at The Monkey Cage about the influence of Brazilian gang members in prison. Two largest gangs, the PCC and the CV, are fighting a war. I think two main points are particularly important.
First, like in El Salvador the Cold War matters, though in a different manner. The CV originated with incarceration practices by the Brazilian dictatorship, which put leftist militants and common criminals together. The latter learned organizational techniques from the former.
Second, mano dura policies that sound good because you're "getting tough" often make the problem worse. The PCC is a unified group built from disparate gangs that came together to protect themselves from the state. Mass incarceration led to imprisoned gang leaders wielding considerable power over the outside world.
The CV originally spread when officials unwisely dispersed its leaders among Rio’s prisons. PCC leaders have also been transferred to or arrested in other states, where they invariably founded local chapters. Conversely, some local copycat prison gangs were founded by inmates who spent time in PCC-controlled prisons in São Paulo.
Once sophisticated gangs emerge within a state’s prison system, they generally begin to organize drug turf in that state’s urban areas. This suggests that the PCC’s and the CV’s organizational know-how constitutes a replicable technology, one that gives them a game-changing advantage over local incumbent gangs.Eventually, you end up where El Salvador went, which is to desperately forge uneasy truces just to bring down the violence. Solving the underlying problem of marginality is a much bigger problem.