These changes are very poorly documented.  The goal is to traverse dependencies, don't traverse dependency loops, and to keep a meaningful order of dependencies inside of list variables (like `INSTALLED_APPS`, `MIDDLEWARE_CLASSES`, etc).

This is the one "magical" function of the set, the engine behind everything.  It's got the ordering right enough that things are working--there are many ways for this code to be changed that it *doesn't* get the ordering right ... :)