Idk. I'd probably put it the other way - part of the state turned into gangs.
Most of the core leadership of major cartels who haven't been arrested were mid-level officers in the DFS (Mexico's version of Italy's SID and Turkey's MIT from Operation Gladio days).
And what is interesting isn't the narcos who are arrested and indicted by the DoJ, but those who are arrested and then let go.
The story of Salvador Cienfuegos is a good example of that - arrested by the DEA on drug charges that were sealed while being Defense Minister, but charges were dropped for diplomatic reasons [0] or the DEA's investigation into AMLO in the 2000s and 2010s that was eventually dropped [1]. Meanwhile, giants like El Chapo or El Viceroy were successfully extradited or in the case of El Mencho killed.
To me, it feels like "untouchables" like Cienfuegos, Adán Augusto López, and Marcelo Ebrard or established networks even above them are likely running the show.
Sort of like how the KGB broke bad in the 90s or the Turkish military in the 1980s-2000s or the KCIA before Korea democratized in the 1990s or how leaders in the vice industry in Thailand tend to be associated with military leadership or how both the IRA and Protestant paramilitaries turned into drug cartels in North Ireland.
I also don't think it's a party ideological thing - PRI, PAN, and now MORENA have the same mid- and upper-level people.
[0] - https://www.nytimes.com/2022/12/08/magazine/mexico-general-c...
[1] - https://www.nytimes.com/2024/02/22/world/americas/mexico-pre...