In several books by different authors historians often refer to diaries. Often, these are diaries of ordinary people. There are also countless statements like Such and such German officer wrote this and that to his wife.
How do these documents (diaries and private correspondence) get into historians' hands (especially during and after World War II)?
I can imagine these scenarios:
A person who witnessed some important event goes to the archive and gives their diary to the archive.
Some old person dies. Their relatives find a diary and instead of throwing it out, send them to an archive.
Letters from the front probably go through a censor. They may have made copies of it and these copies land in the archive.
Today we have blogs which are saved by the Wayback machine and the e-mails are probably stored by service providers like Evernote or government agencies like the NSA. I'm wondering, if my letters and diaries will some time appear in some future historian's research.
Regarding letters, there is a collector's market in covers, which means a stamp with the complete envelope and sometimes with the content as well.
Regarding events in living memory, it is bread-and-butter work for historians and their undergraduate and graduate students to collect oral history. At the time they might ask for permission to copy documents. (Anecdotal and hence not really evidence: I once helped a grad student to find a translator for a polish letter among mostly dutch stuff.)
Regarding WWII, quite a lot of German officers published their viewpoint after the war, mostly to point out why someone else was guilty of the genocide and the lost war. Other Germans then published to refute those claims. Not all got as much publicity as Oskar Gröning did, there is lots and lots once you go into non-digital archives.