random_split returns two Datasets with non-overlapping indices, which were drawn randomly based on the passed lengths, while SubsetRandomSampler accepts the indices directly.
Both can be used for different use cases.
E.g. if you want to run a training epoch with certain samples only (e.g. from a subset of classes or “hard to learn” samples), you could calculate these indices somehow and use a SubsetRandomSampler for this training epoch.
random_split on the other hand splits the dataset randomly, so that you won’t have that much control over it.