Sovereign immunity derives from British common law. It stretches back to the idea the king (or queen) can do no wrong. Since the United States uses British common law as the foundation of our legal system, we too adopted this concept with modifications to suit our Constitutional Republic. Now, sovereign immunity protects the federal and state government from suit. There are a handful of exceptions to this. First, the federal or state government can waive sovereign immunity. An example of this is the Federal Tort Claims Act, which allows citizens to sue the federal government for certain torts. Second, sovereign immunity does not attach when the state or federal government is doing something for its own gain, something that could be done by a private actor, or something that is not a traditional government function. When we say "traditional government functions," we mean the kinds of things governments have been doing for hundreds of years (taxing, creating criminal codes, etc.). A big exception to this, of course, is civil rights. You can always sue a government for violation of your civil rights. Qualified immunity exists to protect government officials from suit in their individual capacity. It also protects those who act on behalf of a municipal government (there are some exceptions to this that are legally complex and do not really affect the overall understanding of the concepts, so I won't waste your time). That is why police rely so heavily on it to protect themselves; they are employed by a municipality, which does not share the state's sovereign immunity. Qualified immunity does not attach if a government official/employee knowingly violated a clearly established right. That squishiness is what makes qualified immunity so effective: the right has to be clearly established. Courts have interpreted this into meaning that there has to be legal precedent (i.e. another court ruling) stating the exact same scenario resulted in a violation of a citizen's rights. So, for example, in the recent shooting of Jacob Blake, qualified immunity could protect the officer who shot Mr. Blake from civil liability if a court determines that it was not obvious that Mr. Blake had a right to walk away from the officer and get in his car. Typically, a court would say "we don't know of any other cases where a man was trying to break up a fight then got shot trying to leave the scene when police arrived and a court found this violated the man's rights, so the right wasn't clearly established." This is why this concept is under so much scrutiny right now: Courts have interpreted this standard incredibly broadly. From experience, it is helpful (and probably just) to use qualified immunity to shield government officials like clerks of court from suits related to how they carry out their day-to-day functions. Where the concept of qualified immunity is damaging to our society is where it allows government officials to enact physical harm on citizens with no repercussions. And they are given such impunity because they keep finding new and different ways to assault citizens.