In British courts, both judges and attorneys wear wool wigs, a custom that originated in the eighteenth century.
The judge’s wig is larger than the lawyer’s, so he’s often called the “bigwig.”
When a crafty lawyer wins at trial against all odds, it’s as though the lawyer had blinded the judge with his own wig.
It’s said he just had “the wool pulled over his eyes.”
The phrase is often used when someone has been fooled or deceived.