I generally agree with your statement, but there is an additional function of agencies like the FBI (no, it's not to do with their PR campaigns on catching serial killers and child abuse rings).
It's best explained by looking at the behavior of the US pharmaceutical corporations relative to outfits like Mexican and South American drug cartels. Both engage in the same business: selling drugs to consumers, but one is extremely violent, one is not. Most of the violence in the illegal drug trade is cartel-on-cartel violence, with a fair amount of innocent bystanders. Imagine if say, Purdue Pharma or Gilead were conducting armed raids on each other production lines, hijacking each others shipments, etc. Similarly, what if a mid-level manager at Johnson & Johnson were to abscond with millions of dollars in product and set up a rival operation?
These corporations are all ultimately owned by Wall Street investors, by and large. This is who the FBI is there to serve and protect, a lot of people misunderstand that. They prevent such shenanigans as the drug cartels get up to (wholesale murder I mean) by investigating internal corporate crimes of that nature. Otherwise, the CEOs would be hiring private security (like cartel enforcers) to crack down on such things, in a extrajudicial process. The FBI also covers for the crimes of the mighty and powerful, too - HSBC laundering $2 billion in Sinaloa cartel drug money comes to mind, and then future FBI Director James Comey went to 'advise' them. No criminal charges were brought.
If we look at Wall Street as a kind of white-collar organized crime ring, the FBI is basically their enforcement arm. This is why so many top top-level FBI types 'retire' to lucrative positions in Wall Street firms, as Mueller did. It's a rather telling trend.
I suppose the kind of political operations they get up to are also in service of this general agenda, i.e. going after politicians who threaten Wall Street interests, covering up certain outrageous crimes that would reflect badly on the pillars of society, and so on. Overall, rather similar in function to the Soviet NKVD and the German Gestapo (and later, STASI), although not quite as powerful (they still can be embarrassed in legal proceedings, see the Steven Hatfill case, the Leonard Peltier case, etc.).
So, they serve a particular function for their Wall Street masters, but it's a pretty sleazy world they live in, and nobody should trust them anymore than you'd trust some STASI operative.