Gang warfare is a gameplay feature in Grand Theft Auto: San Andreas.
It is available upon completion of Sweet‘s mission Doberman, but is temporarily unavailable between The Green Sabre and Home Coming. Taking over enemy gang territory gives the player more Respect and Money. The money is generated over time and can be collected in Grove Street outside the Johnson House. Neighborhoods also become safer for CJ to travel around since enemy gang members will no longer appear in the area, instead being controlled by the Grove Street Families.
https://gta.fandom.com/wiki/Gang_Warfare_in_GTA_San_Andreas
In GTA V you can get the same gameplay using this mod: