This is heavily oversimplified, but here goes:
In a nutshell, the Truman Doctrine, post WWII, involved the “containment” of communism. We weren’t going to start WWIII, but we were going to make damn sure it wouldn’t SPREAD. The Cold War was off and running.
Tailgunner Joe got his start by making a large public noise about suspected communist sympathizers in the State Department. From there, it kind of spread. Richard Nixon got a huge amount of political mileage by jumping on the bandwagon and bending the law in order to nail State Department employee Alger Hiss on charges of espionage.
A variety of other Congressmen, particularly the ones on HUAC, thought this was peachy, and the witch hunt was on. The hearings dealing with movie and television stars got the most publicity; at one point, even Lucille Ball got dragged in, because she WAS a member of the Communist Party at one point. Husband Desi Arnaz appeared before the committee, laughing the whole thing off as a ditzy redhead thing to do, back before she understood what Communism was all about, and remarked “(These days,) the only thing red about Lucy is her hair. And even that’s not real.”
Others weren’t so lucky. Writers, in particular, got blacklisted in droves. The “blacklist” was basically a series of unofficial lists of names of folks who had either refused to cooperate with HUAC… or had been unsufficiently helpful to HUAC… or were known communists… or who had been NAMED as communists (or even SUSPECTED commies) by people who HAD named names for HUAC.
You could also get on the blacklist by ASSOCIATING with someone on the blacklist… or HIRING someone who was on the blacklist. Movie studios in particular made a point of cutting loose any of their actors, writers, or other employees who were “suspicious.”
Much of the stink arose over the Fifth Amendment, which guarantees you the right to not be forced to incriminate yourself in a court of law. People who didn’t like being pushed around and bullied during HUAC hearings often took the fifth. This became a tactic by which HUAC could make them look guilty, simply because they refused to talk, and also allowed HUAC to find them guilty of “Contempt Of Congress” for refusing to answer questions. Several folks were jailed for this, Fifth Amendment rights notwithstanding.
It all made great theatre, and the guys on HUAC were having a fine time, making lots of political hay out of it. Why deal with sticky REAL issues and problems when you could just go on TV and be seen by the voting public, terrorizing “commies?”
…and then McCarthy decided to go after the Army.
The idea of ripping apart the Armed Forces the way they’d scrambled the State Department and the entertainment business struck the saner members of the government as a bad idea. McCarthy, though, refused to back down, and was eventually censured by Congress. He drank himself to death a few years later, after losing his bid for reelection.