From the GNU coreutils manual:
Sort by hashing the input keys and then sorting the hash values. Choose the hash function at random, ensuring that it is free of collisions so that differing keys have differing hash values. This is like a random permutation of the inputs (see shuf invocation), except that keys with the same value sort together.
If multiple random sort fields are specified, the same random hash function is used for all fields. To use different random hash functions for different fields, you can invoke sort more than once.
GNU sort -R takes the same input and lumps it together; This thread may offer some alternatives: How can I randomize the lines in a file using standard tools on Red Hat Linux?