Historically, it came from England where the king was perceived as someone who could do no wrong, so the king had immunity for certain acts. The United States took over that legal theory that the government could do no wrong. The Tort Claims Act has exceptions to the theory that the government can do no wrong, and when they will drop the immunity. Then you can bring a lawsuit, but the necessary requirement when you file a lawsuit against a state or county or a sub-division, is about two years of the event or the unlawful conduct.
You can file a claim and let them decide whether or not they are immune, and you can still file a suit if you discredit that information. If you get to it early enough and it is a county, you can file the tort claim. They may deny the claim for various reasons such as the claim of immunity or a claim they did not do anything wrong. Then the attorney of the claim determines whether they agree with the determination and whether or not they think they should report the lawsuit.
They can file a lawsuit, then the county or the political subdivision can file an answer to the lawsuit or seek to dismiss it, based on the immunity that they claim. Or, the court can decide whether or not that immunity applies.