A key nuance is that open source has largely only devalued software that any competent software engineer could write. In this sense, open source replaces software that was essentially selling labor rather than expertise. A developer always has the option to write this software themselves if they don't want to pay for it. The price of a product of undifferentiated labor will converge on the cost of that labor in a well-functioning market, which in the case of open source is effectively zero.
On the other hand, software that requires rare and difficult to acquire expertise -- software development where competence is insufficient -- faces little threat from open source in practice. This creates two-tier markets that differentiate on the replicability of capability. Products that are replicable by any software developer eventually will be in open source. But there are still large gaps in capabilities between closed and open source in some markets because the average software developer has no obvious way to replicate those capabilities on a purely technical level.
In essence, you can only make money if you are doing hardcore R&D. This strongly incentivizes the creation of new capabilities but also disincentivizes publication of CS research.
You see this in markets like databases, where open source has captured almost the entire market for undifferentiated capabilities, and there is a lucrative high-end market with unique product capabilities that don't exist in open source or CS literature. The trend toward treating CS research as trade secrets, originally started because algorithm patents were impractical to enforce, turned out to be effective at maintaining profitability in high-end software products if open source can't replicate capability.