Final answer:
Judges and magistrates are protected from being sued for their judicial acts by judicial immunity, supporting judicial independence. There are narrow exceptions where judicial immunity may not apply. Historical cases like Marbury v. Madison illustrate the boundaries and protections of judicial power.
Step-by-step explanation:
Generally, judges and magistrates have judicial immunity when acting in their official capacity, thus protecting them from being sued for their judicial acts. This immunity applies even if the judge's acts are done maliciously or corruptly. However, there are exceptions where actions taken by a judge may fall outside of this immunity, such as when acts are done in the complete absence of all jurisdiction, or are not judicial in nature.
It is a principle embedded in the legal system to ensure judicial independence, so judges can make decisions based on law and their interpretations of it, rather than out of fear of personal consequences.
The case of William Marbury against James Madison, known as Marbury v. Madison, provides an example related to judicial function and the limitations on judicial power. Supreme Court Chief Justice John Marshall ruled that the Supreme Court could not grant Marbury his writ because the Judiciary Act of 1789, which had granted the Court this power, was unconstitutional under Article III of the U.S. Constitution.