Ref T13209. In PHP7 and newer, the function random_bytes() gives us simple access to cryptographic randomness across platforms. Prefer it if it's available.
Notably, the other sources often aren't available on Windows, and particularly aren't available on a clean/default install with modern software versions. So the major motivation is to make things work better out-of-the-box on Windows.