Not to deter further discussion, but there's a good answer by /u/estherke here.
There's a lot more information available in the FAQ section on the Holocaust and Nazi Crimes Against Humanity.
Estherke's answer is on point and I agree with their characterization entirely. I would add a few things pertinent to your particular quesiton:
TLDR: There were rumors of these camps that were slowly substantiated, the rapidity of the political and military situation in Europe lead to confusion. Intentional obscuration by Nazis further confused things, governments not affiliated with the Nazis did very little (if anything) to hide the atrocities that took place in the camps.
I hope my rambling answers your question.
Works consulted: FDR and the Holocaust - Great for information related to the US governments thought process on the Holocaust ('What did the President know and when did he know it' kinda stuff) The Rise and Fall of the Third Reich - Talks a lot about the Einsatzgruppen and their role in the Holocaust as well as their practice in the field. There's also a good chunk on the Nazis consciousness of the Holocaust. Accounts of the Wannsee Conference - They knew they had to be less upfront about what they were doing and how they were doing it. Hitler's Willing Executioners - Perhaps a little inflammatory, cited here for sake of completeness, it does a good job making arguments for who knew what and when in Europe.