I find this question harder than it seems because a lot of crime fiction uses gangs as a kind of dramatic shorthand. Many books have them as generic, faceless antagonists, which feels unrealistic. The ones that stand out to me for realistic conflict are the ones that focus on the internal logic—the territory disputes, the shaky alliances, the economic pressures.
A series that comes to mind is 'The Power of the Dog' by Don Winslow. It's not just about cartels shooting each other; it's a decades-spanning look at the drug trade, showing how political decisions and law enforcement strategies in the U.S. directly fuel the violence between Mexican organizations. The rivalries feel inevitable and systemic, not just personal vendettas.
On a different, more localized scale, I'd say 'The Street' by Ann Petry, though it's more literary. The tension and competition in a 1940s Harlem setting, where systemic oppression creates a brutal environment for survival, has a realism about conflict that many modern crime novels miss. The rivalries aren't always named gangs, but the struggle for control and respect on the block is palpable.