I am not sure about Delta's situation, but usually, when an airline gradually retires a fleet type, it retires those that are due for "C" check first. So, if N813DE is scheduled for its C check prior to N807DE (and I am just making a hypothetical scenario), it would retire 813 first rather than spend the money on its inspection, since the airline is planning to retire the fleet type in a definite period of time anyway. 807 might keep flying past 813, even though it is older, if its C check date is later.
Now, all things being equal, there is no magic formula, etched in stone to make these determinations. An airline may decide to retire certain aircraft first if such aircraft have more airframe hours or have had more maintenance issues of late. Even a fleet of the same aircraft type has its top and low performers. For instance, I am a 747 pilot (744 currently), although I also flew the 100s and 200s when they were in service. And I recall that a few specific aircraft had little quirks and were more prone to needing the mechanic's wrench than others. So, if an airline is deciding to retire a fleet type, it could pick the one or two annoying machines to go first. But I would imagine most airlines use the C check dates as a guide for choosing which ones go first.