The Cali Cartel suffered from an ongoing witch hunt that Pablo had caused.
What I mean to ask here is that Pablo wanted to lead the country (or atleast have political power), so he murders several people for that, goes for an all-out war with the authorities, bombs planes etc...
You're close, but not quite right. Pablo saw himself as Robin Hood. He wanted to be adored by the people, which is why he helps the people.
Pablo didn't want political power for the sake of power. He wanted political power so that he could help more people, and in turn get more adoration.
Look at the pilot episode. Pablo is confident that he can talk the guards into allowing him to pass, because Pablo is charming and a good negotiator. He's able of swaying individuals with bribes (and the implicit threat of death if they refuse the bribe, plata o plomo, silver (money) or lead (bullets)).
But he assumed that swaying the public would be as simple as swaying a few people, which is simply not the case. He overplayed his hand by trying to make himself a public figure. He was already a public figure in Medellin, but now he's trying to become a public figure to a point where the media reports on him.
Not only does he not get the public adoration (as a public figure), he also ends up hurting his former position. Because of the increased public visibility, he is now being scrutinized, which increases the public outcry about Pablo's shady dealings. This increased scrutiny makes others (who were bribed by Pablo) less likely to openly want to be connected to him.
Pablo, however, does not understand that he is the one who made the mistake. His violent response to being denied a place in the government is nothing more than a temper tantrum. Pablo wants to hurt those who hurt him. And if the people do not want to love him, then he will make them fear him. (I think Pablo even explicitly states this at some point, but I could be mistaken)
This temper tantrum then further solidifies the scrutiny that Pablo (and all other drug cartels) are put under. This leads to increased efforts to taking Pablo down, and ends up being his downfall.
Enter the Cali Cartel.
They had learned from Pablo's mistakes. They avoided public sightings (with few exceptions, like the Carnival celebrations), and they put a lot of effort into looking legit (as opposed to Pablo's assumption that he can talk his way out of anything).
The Colombian government was happy enough with the proposed peaceful deal. However, the US government was not, as the drugs were still flowing into the US.
Peña does what he does specifically to prevent more drugs from making it to the US (which is shown by Peña staring at the drug boats in the finale). Although the higher ups (the Ambassador and the CIA) are more interested in politics over drug prevention, Peña does not care about politics.
The Cali Cartel could not have prevented their own demise.
They were brought down by external factors (Peña) that they had no control over. Peña used the situation that Pablo left behind (public outcry about drug cartels, friends that Peña had made along the way when chasing Pablo, all knowledge he had gained from chasing Pablo, ...)
Peña wanted to take down Cali before they had the chance of committing atrocities like Pablo did. In essence, Peña assumed that the Cali Cartel would inevitably end up equally violent to Pablo (who had initially been peaceful too).
They also had no way of seeing this coming. Could they have prevented it, if they were aware about Peña and what he was doing? Maybe. But they weren't initially aware of him, and therefore were unable to do anything about it.