Is bit-rot more a function when the file is written, or something that occurs over time ?
The jist I'm getting from this thread is that it happens over time.
There are many causes:
1. Corruption on hard drives because a sector has become corrupted an unreadable (tends to result in loss of a whole sector, 512 bytes, or more commonly these days 4096 bytes).
2. Random bit flips (overclocking, flaky hardware, cosmic rays)
3. Random corruptions (software bugs, loose or damaged cables, RAID card malfunction)
Point 1 happens over time when the data is simply being stored. Due to some sort of hard drive malfunction, a sector may not be readable (perhaps, there was a power glitch or vibration during writing data, and the drive's self diagnostics didn't notice the glitch and retry; or perhaps that bit of platter is a bit weak; or perhaps there was a glitch during reading).
This is more of an issue these days as we now store more data, but the overall reliability of storage hasn't increased. Traditionally hard drives were specified for a approximately 1 unreadable sector in every 10 TB written - not much of an issue when we had 10 GB drives. With modern 4 TB drives, it's potentially 50:50 that if you fill a drive completely, you'll get it all back (OK. That's a worst case specification, in practice, performance is better than that, but you get the point).
If you've got RAID, then this type of corruption can be detected as it happens. Most high-end RAID cards will automatically read all the data on all the connected hard drives, and correlate the data to make sure it is consistent. They will generate an alert if the data doesn't match. Modern file systems like ReFS and ZFS, have checksums. If you have redundancy as well, they can automatically work out which hard drive had the correct data during a background scan and correct it automatically in the background.
2. These sorts of corruptions when data is in transit. Data might be copied to RAM, and the RAM might suffer random corruption for some reason, before the data gets copied back to HD. Cosmic rays are really rare (about 1 bit flip per GB per year), but if you've doing a lot of data moving, it can happen. More likely, is that you have some borderline RAM or bordeline CPU/mobo combo, which can cause random RAM corruption more frequently. This is especially true if overclocked.
3. Any kind of malfunctioning hardware or software can cause random data corruption. E.g. an OS crash might cause the file system to go crazy and save data in the wrong place on a hard drive, corrupting a random file. Bad cables can cause strange errors - I once had a USB hard drive that I used to archive photos, it corrupted a couple of dozen, by just missing out a sector when writing the files, every now and again. Similarly, a friend had a hardware RAID card on a server go crazy, and it just spewed out random crap onto all the connected hard drives.