It’s actually quite easy to get into this situation, it happened on my team not too long ago due to a bad script.
Take this for example
rm -r $dir/*
If somehow $dir becomes undefined, it would try to wipe out all the files in the system it has permission for, namely your /home directory. You’all be surprised how much of your work is stored in there.