In the old Western movies and TV shows, it was easy to tell the good guys from the bad guys. The heroes wore white hats (Exhibit A: The Lone Ranger), and the villains wore black hats. Right?
Well, not so much. It turns out that a comprehensive look at the Western film genre shows that there was actually no consistency in this regard. There were good guys wearing black and bad guys wearing white. But for some reason, we as a culture have made this literal black-and-white distinction.
So much so, in fact, that we now use the terms “white hat” and “black hat” to distinguish benevolent vs. malevolent intent in other areas. The prime example is found in cybersecurity. “Black hat” hackers are the bad guys who try to infiltrate computer systems and networks, steal data, and make life generally miserable for people. “White hat” hackers are the ones who try to find system vulnerabilities and report them so they can be patched before the black-hat hackers can exploit them.