Two primary reasons come to mind.
1. The document was already created. The redacted part is just that, it’s censoring the document after the fact. Then copies of the redacted document are made because multiple people want to see it at once or are requesting it. But somebody has gone through the original document and censored (redacted) all of the information that wasn’t releasable for various reasons (couple be privacy protections, could be because they contain secrets not yet declassified).
2. The document was requested, normally through the Freedom of Information Act (FOIA) which is basically a law that says you have public access to all federal agency records except for those records (or portions of those records) that are protected… With that there are 9 categories of protected things such as still classified. So in that case a federal agency has to provide access to those records (physical or digitally) and they will redact the still protected part as applicable.
Latest Answers