There are 3 kinds of contempt, and a lot of confusion about them.
- Civil contempt. Sanctions imposed directly by judge on finding preponderance of evidence. Sanctions can only be used as stick to achieve compliance. Sanctions must stop when compliance is achieved. ("The defendant holds the keys to her cell").
- Criminal contempt is like a normal criminal case (at least I'm the federal courts). Original judge refers a case, then US attorneys prosecute it. All of the normal criminal process applies, including arraignment, pleas, and trial by jury. Criminal contempt cases are tried by a different judge than the original referring judge. There benefit of all the extra process is that it can impose punishment sanctions to punish past contempt that is no longer ongoing.
- a facie curiae, which means in the face of the court. This allows a judge to directly impose punishment sanctions, like fixed jail terms, for blatant disrespect or disobedience in the courtroom. Unlike #2, this can be imposed directly by the original judge in a summary process. No pleas or trial by jury. That is a huge amount of power. So to balance it out, it is limited geographically to the courtroom itself, and it is limited in time to when the court is in session and the judge is on the bench.
I think a lot of people have maybe seen #3 on some court TV highlight reels, and they get confused why this power is not being applied to this administration.
And the answer is that #2 applies instead, because they are smart enough to keep the contempt out of the courtroom. (And of course #2 doesn't happen because they control the prosecutors).
And the agency heads will dilly-dally right up until the #1 sanctions start to really bite, then they will come into compliance at the last minute. That's why you get a lot of headlines where it's like they finally complied, and there's no consequences for the delay. Because #1 doesn't have the power to impose those consequences. It's #2.