That might be a question for security.stackexchange.com but I'm sure it has been asked before somewhere.
Basically, it masks "free space", so no one can tell how much data you have on your encrypted partition and where it is stored. How important that is to you is your affair.
If the disk was in use before that, it also gets rid of old, unencrypted data. Although zeroes would serve just as well in that regard, unless you have a smart media that compresses, deduplicates, trims instead of physically writing zeroes. So random data (like
shred -n 1 or zeroing a random key crypt) is preferrable, as it can't be optimized away.
In general, though, it has very little effect on security, provided you have a good cipher. I use cryptsetup/LUKS on my SSD, but I happily allow TRIM which effectively zeroes out free areas so they're visible from the outside. I'm fine with that, the data itself is still encrypted anyway.
People worry way too much about this and way too little about unencrypted
/boot that is easy to tamper with and keylog your passphrase... put
/boot on USB with encrypted keyfiles and the USB in your pocket everywhere you go...