First off, before anyone says it, it's NOT blockers lol, which is the common lazy explanation for everything these days. 9862 simply has more outs.
Think about how each hand can improve on the turn: 9876 turns two pair plus a straight draw on a 9, 8, and 7; trips on a 6; additional straight draws of various types on a non-spade J, T, 5, and 4; plus flush draws on other spades. 9862 turns two pair on a 9, 8, and 2; trips on a 6; additional draws of various types on a non-spade J, T, 7, 5, and 4; plus flush draws on other spades. (Relevant areas of comparison bolded for clarity.)
9876's turns are generally of slightly better quality on average, but not by that much. On a 9 turn, for example, 9876 has 72% equity against AA, and 9862 has 70% -- the extra OESD doesn't help as much as it may seem, because AA is basically looking for the board to pair or to improve its side cards or to have the better hand already in both cases, and it doesn't matter if 986x wins with a straight unless that straight is actually necessary that time. The difference is that 9862 has more (and higher quality!) backdoor draw possibilities, which might look surprising at first since 987 appears to be a backdoor dream. The T and the 5 are both better for 9862 than 9876. How? Well, because 9876 has redundancy working against it -- both hands are pair + draws with a similar number of straight outs, but many of 9876's straight outs are also two pair outs.