it dates back to the Russian Revolution and the first Red Scare, along with the early American organized labor movement. there are sprinklings of anarchism as well, but the term "socialism" evolved into a catch-all for all of those groups by the time McCarthy took the helm
I thought they were more on communism
they're basically synonyms in American political lingo