Real segregation, helped
Granular material in a rotating drum genuinely does segregate by size and density. It is a real effect with a substantial literature behind it, and if you run a physical drum for long enough you will see bands form.
The problem is timescale and reliability. Real segregation takes minutes to hours and often produces a partial, messy result. Building a thirty-second video on it would mean either an extremely fast forward or a run that frequently fails to finish.
So the drum provides the motion and a weak per-colour affinity provides the ordering. Every colour owns a slot along the axis, and one linear pass per step nudges balls toward theirs. The affinity is deliberately weak: it has to lose to the tumbling moment to moment, and only win over the length of the run.

