Your browser (or other download app) may even have problems writing a downloaded file to disk. Your backup app may have problems when writing out your backup. A compression app may experience problems while creating an archive. An office app might suffer a glitch at the wrong time while saving a document.
This can happen in various ways, the most common of which is when an app suffers an error while saving or creating a file. Usually, files become corrupted when being written to a disk.