Amazon started as a retailer but has become a publisher too. It started with its Encore program aimed at identifying overlooked books and authors. That was followed by the creation of a service called CreateSpace aimed at self-published authors. And now Amazon has begun publishing mainstream authors.
Amazon didn't start as a retailer; they started as a tech company. At heart, that's what they are. That website you buy things from is just one of the businesses started by Amazon Technologies Inc.They also do cloud storage. They also developed the Kindle in house at Lab126. I don't have a list at hand of all the things Amazon do, but if you gathered that list you'd be surprised at its length.
BTW, the company's actual name really is Amazon Technologies Inc. I suspect that they refer to the company as Amazon.com to distract you from the reality that they have more in common with Google than with Walmart. (If you're surprised by anything I've written, then it worked.)
TBH, I think it's the mindset of Amazon that makes them strong. They have the drive to come up with new and better solutions to problems, and that's why Amazon is a retail giant.
If a publisher bought either Borders or B&N, they would be buying a dysfunctional mindset. I'm not yet convinced that the big box store is dead (Books a Million turned a profit last year), but I do think there is something wrong in how they are being run. Both major chains have been losing money for some time now; obviously they must be doing something wrong.
Also, if a publisher bought one of the chains, that publisher would face a lot of resistance. "That's not how we do things here" would be heard a lot. Absent a radical restructuring, my bet is that resistance would doom the effort.
If you really want to compete with Amazon, you need to stop thinking like publisher and retailer and start thinking like a tech company.