Western countries require judges to wear black robes and wigs. There is a story behind this. Wig fashion began with King Louis XIII of France, especially in the 17th century, as a symbol of social status. It is a symbol of social status and is marked by many professions. But the French Revolution and the American Revolutionary War cleaned up the muddy water. The revolutionaries swept away all symbols of status and class, so now only the court systems of Britain and a few other countries still retain this custom. Judges in the UK and former Commonwealth countries and regions, including Hong Kong, wear shawl wigs, lawyers wear small wigs, and both judges and lawyers wear robes, usually black. Opening a court session under such decoration gives people a very grand feeling. It is said that when a judge puts on a black robe and fake laws, he can hide his true colors, get rid of his selfish thoughts, and become the embodiment of the rule of law and the embodiment of truth, goodness, and beauty.
Jefferson, the third president of the United States, once criticized wigs. He said that he hated the British judge's wig. The scene of the eerie little eyes behind the wig shining with blue light was simply unacceptable. The United States also abolished wigs and robes, but later reinstated robes. Wigs and robes create an atmosphere that emphasizes the importance of the judge's role and the importance of his position.
Of course, some places are not necessarily so strict now, and sometimes there are no wigs and empty robes.
Reference materials:
/question/index?qid=7006032900971