Open source is different, in that you as a company can become maintainer and therefore expert of that component _and_ profit of other work being upstreamed. In case the library is not your USP, I think it's not that clear cut.
Or in the context of Boeing, Boeing shouldn't be in the business of making its own bolts. An internal lack of bolt expertise isn't what caused the door plug to fly out.
Unique Selling Proposition. If the thing the library implements does not substantially differentiate your company from others, it's a candidate to be maintained as open source project. For example, just become an expert ffmpeg user if you're a live streaming service. Your USP is your content, transcoding just needs to work. In contrast, if you're Dolby, that would probably not be the right strategy.