Well, that’s only true if you plan to sell the code. Much code exists not for its own sake, but to support the business. Maybe you need to build an in house inventory system for some kind of complex product you’re building. You were never gonna sell that software, but you still won’t open source it because that would help your competitors...
Well, and if it's so tied into an in-house inventory system just tossing a bunch of code into a Github repo is about 99% useless. There is almost zero value to just tossing some open source code over the wall.