I realize my question may be fairly wide. I've been reading books about piracy in the 18th century and I realized most of what we know comes from contemporary books or newspapers, a lot of letters and court and trade records. I imagine this is the case for many parts of history, but how did these records, especially letters that aren't reprinted, last so long through ages when they physically had to be stored somewhere safe?
First off, it is important to point out that documents very often do not survive, and that there is an element of survivorship bias to merely talking about those that do. There are a multitude of reasons that documents or records may not survive: e.g., the records of the Vatican were on papyrus up through the 11th c., and Rome is not a particularly conducive environment for papyrus, so we have almost no records from before they switched to parchment, which is much more stable and long-lived in the circumstances. Papyrus generally only survives survives in the dry desert conditions of Egypt beyond the reach of the flood. In Ethiopia, the biphasic or triphasic weather patterns, with huge repeated swings in humidity, are largely terrible for any kind of soft documentary medium (as opposed to metal/stone) to survive, and the ancient tombs that might have had documents in Aksum were at the base of a hill and filled with water during the rainy season. Early motion picture film was not chemically stable, and would degrade to a kind of messy 'soup' in the closed film canisters. That is before we even get to fires, repurposing, rodents, floods, and all the other enemies of documents surviving.
That said, let's talk about documents that do survive, and since you are interested in the 18th century, largely paper documents (though some English government records were still on parchment during this period). The first important thing to understand about most paper records is that when they are left alone, undisturbed, in conditions of relatively stable temperature and humidity and no direct sunlight, that their shelf life is very long. Even wood-pulp paper (not yet used in the period in question), which has the problem of 'Slow Fires' (so called after the 1976 film on this problem: it becomes brittle and develops spots known as 'foxing') from the acid in the pulp, will reach a stable (though brittle) equilibrium on the shelf. Which is to say that benign neglect is a relatively optimal condition for the survival of paper documents, so anywhere that they might have been left in a drawer or on a shelf, they had a high chance of surviving, even with no archival intervention.
Another important thing to understand is that many documents were kept in duplicate: charters were issued to the interested parties but then also had copies recorded in books called cartularies; many famous letter writers kept copies of the letters that they sent alongside the ones that they received, institutions sending letters even more likely; newspapers were printed en masse; churches, monasteries, and governments of all levels kept records of their transactions and would often have rooms for storing documents; when institutions closed, there was often a responsible party that inherited the documents: for churches, the diocese; for monasteries, the mother house; for banks or trading institutions, whoever took over their debts and responsibilities (or if not, generally the municipality): see, for example, the surviving records of the Banco di Napoli (pictures here and a few more here). As state archives, libraries, and museums expanded, they often acquired documents which were in danger of no longer having a keeper or otherwise neglected: the federal and state libraries in Germany contains the archives of hundreds of churches and monasteries, for example. Letter collections and papers from the estate of famous authors are often preserved (and jealously guarded) by the family. For a while, every decent local library in the U.S. would have years, if not full runs, of all the local and major national newspapers for consultation; eventually, they were largely replaced by microfilm/microfiche, and now digital (in fact, the New York Times apparently threw away its own full-run print archive of the paper at some point, and I believe there is now only one that survives).
So, as much as survival might be a bias, there are a lot of reasons why institutions and individuals might keep paper documents which often will survive for long periods of time while neglected.