@thehipsternugget
There are three main reasons why files can become corrupted, and two of them can easily pprevented.
1) two different file access operations at the same time.
This is what was mentioned above as cloudsync as that is the most common variant: a cloudsync happening while the editor is active.
And the most problematic part here is that Microsoft tries to get your files into Onedrive without telling people the consequences, because Onedrive is a cloudbased program.
2) Power failure on the drive
To speed up everything, your data on your drives is cached in its RAM-cache first and physically saved onto disc only afterwards.
The main reason for the shutdown sequence is actually to wait until the harddrive gives the all-clear of having saved the cached operations before cutting power to the drive.
For USB-Drives there is actually a setting somewhere to determine if their cache is used or not, to either speed them up or to make them slower but safer agains sudden removal from the port.
And never forget that having a main switch at your power connector to cut off power to computer, monitor, printer and more is actually an artificial power failure if that switch is used before shutdown is complete.
3) Regular file corruption
This is the rarest case, and you have absolutely no control over it.
Any file can become corrupted by accident, which is why people tell you to make backups of your important data.