Why do judges wear wigs?

7

Why do judges wear wigs?