I've never understood how riding in the same direction is safer. The rider can't see me, so it feels like I'm creeping up on them. I feel there should be some degree of coordination when a car is approaching a bike, some eye contact, you know? But that can't be done when they're riding in the same direction.
I've never ridden a bike in traffic before, but I'm sure I'd feel really nervous to have an unknown set of cars approaching me from behind and passing by me unexpectedly.
Is it about reducing the relative velocity between them? I'm sure it's still significantly high even when going in the same direction.
EDIT: Here, I'm mostly thinking in the context of highways. It may be that the rule makes more sense in a city- or suburban-like environment.