There were many periods of anti-communist sentiment in the United States, each having its own set of domestic and international issues. Many consider the 1930s to be the "heyday" of American Communism (see Harvey Klehr's book) because that's when the US was closest to revolution (due to the 1929 stock market crash and millions of unemployed workers- i.e., Communists' ideas seemed pretty good to the downtrodden). So, in the 1930s, the anti-communist sentiment was very much a fear of a domestic revolution- it seemed that Marx was right (in some regards), and that capitalism couldn't support itself. In 1935, the Party entered the Popular Front era, meaning it was more acceptable for communists to associate with liberals, democrats, moderates, union organizers, etc. to push for rights for the working class. So Party influence was at an all-time high. Many historians note that if the US was ever to have a communist revolution, it would've been then due to the Party's influence on politics and culture (and would have been very different from Maoist China or the Bolshevik revolution). This all fell apart when Stalin signed the Soviet-German non-aggression pact, essentially making nice with the Popular Front's greatest enemy: fascism.
In 1938, the House of Un-American Activities Committee (HUAC established the Dies committee to hunt for Nazi's in the country, which led to suppression of other political groups, like the communists and socialists. From there, there was no real turning back. After the US entered WWII, the threat of attacks on the US gained credence, and political suppression was seen as a legitimate way to preserve domestic and international peace. I have less expertise in the post-war era and communism, so if someone wants to step in on that, that would be great. But in general, after the communist witch-hunt of the 1950s, most Americans no longer feared the communist revolution, but instead feared espionage and Soviet attacks.