As I recall, Borders was taken down more by their own decision to focus heavily on physical-format music sales (and movies/media), which ultimately turned out to be a VERY bad idea because, y’know, technology. It was literally “Borders Books & Music,” and Barnes and Noble was scrambling to keep up with that… but then the wind changed and it turned out that hitching their horse to CDs bit them in the ass when digital distribution turned from piracy tech fad into the mainstream accessible norm.
Additionally, I seem to remember reading that (somewhat paradoxically) Borders’ absolutely abysmal online sales platform also contributed to its demise, and part of the reason that Barnes and Noble survived was because theirs wasn’t as terrible? Which makes a kind of sense… if there was only space in the market for one of them against Amazon, the one that offered better competitive services in that sphere would probably be the survivor.