O'Reilly didn't just carry their own books in their shop. They have print on demand contracts with smaller publishers that can't afford to hire printers to publish large batches of their books. O'Reilly allows them to upload a copy of their books, and then they print the books for them, as they are sold. As well as those books also being offered through O'Reilly's shop, these smaller publishers could then sell print editions on their own site, too, only ordering from O'Reilly what they actually have already sold, with O'Reilly shipping them direct to the customers, as well as O'Reilly taking it upon themselves printing up additional copies for titles that seem to sell well, which O'Reilly offers on Amazon and elsewhere.
I have been told that there will be some changes on the current O'Reilly shop pages, to include Amazon buttons for the affected print on demand books, located below the button for reading it on Safari. But to me, this does create a bit of a sticky situation, where many of these small publishers have their own subscription based service for their e-books (most of which are DRM-free), with O'Reilly now becoming a bigger form of competition to them, offering an inferior version of the digital versions (in my opinion any way), while still remaining the actual printer of their books.
I am not sure I'd entirely define this kind of relationship as "friendly competition", or a "mutually beneficial symbiotic relationship", or even as a "benign parasite". (but that's just my personal opinion)