What's the legal theory behind "contempt of court"?
For most laws, a legislative body determines what is and what is not legal. The executive branch enforces those laws. Then the judiciary determines guilt or innocence. Three branches, checks and balances, etc.
But, for contempt of court, the judge determines what is and what is not legal. The judge enforces that rule. And then the judge finds you guilty or innocent.
How does this comport with the American system of government?