The growth of McCarthyism has its roots long before the 1950's. As the United States became an industrial power in the late 1800's, the system of capitalism caused many people to question if we were on the right track. As most of the wealth went to a very few people and the vast majority of urban Americans worked in unsafe conditions for long hours and with little pay, the system seemed unfair. Anarchists around Europe and the United States began a campaign to challenge the sytem they viewed as degrading, unjust, and corrupt.
When political leaders in the US and Europe were being assassinated in alarming numbers (President McKinley, Archduke Ferdinand, Tsar Nicholas and his family) the political and economic elites began to take notice. Law were passed to stifle dissent and people who spoke out against the capitalist system were deported or imprisoned.
During WWI, which leaders on the left saw as a war being fought by the poor for the benefit of the rich, the Bolsheviks took over in Russia. This event shocked political and economic elites here and in Europe, and the government clamped down tighter on dissent.
The Great Depression settled the question for many who saw that capitalism in this form was failing. As Stalin began to rebuild the Soviet Union, people in larger numbers were accepting Communism as a viable alternative. Political candidates who declared themselves socialists or Communists were running in elections and sometimes winning. But Stalin's atrocities were slow to come to light and when they did, the enchantment with Communism by intellectuals on the left evaporated.
But the US government was taking no chances and when HUAC in the House and McCarthy in the Senate began searching for Communists with a campaign marked by its paranoia and recklessness, few people had the courage to stand up to the assault. The logic was that only Communists would dare challenge a Communist witch hunt, so few people did.
The Korean War and rise of Communist China added fuel to the things the US government had to fear and it was in this climate that McCarthyism flourished. McCarthy's reckless and abnormal behavior eventually brought him down, but Communism was never going to be thought of as viable system again.
The major reason for the growth of McCarthyism in the early 1950s was the fact that communism seemed to be spreading world wide. Because it seemed to be spreading, there was fear that it would make inroads in the United States through "fifth columns" of communist sympathizers.
In the early 1950s, communism seemed to be spreading and becoming stronger. China had become communist. The Soviet Union had developed nuclear weapons. The North Koreans had invaded South Korea and had been helped by the Chinese. These developments made it seem as if communism was on the march and it therefore seemed quite logical to many Americans that communists would be infiltrating the US. This made McCarthy's claims and concerns seem plausible to many Americans.