>
once a piece of software became stable and profitable you would need a much smaller engineering staff than when it was being builtThis is not generally the case, except in monopoly situations.
Your software product generally has a competitor, and they're busy trying to make theirs better than yours -- whether with more features, better integrations, whatever it is.
So your staff size generally stays about the same in order to build more features desired by customers to prevent customers from switching to your competitor and you go out of business. And certain features, by themselves, can be more complex than the entire v1 of a product. And/or involve massive refactoring, etc.
The companies that get to reduce their team size are often because they're in a monopoly position, and then customers suffer because the software gets stagnant and the features they need don't get built. That's capitalism failing.
Also, something like an internal chat app isn't always a bad decision. If your company is above a certain size headcount, it can literally be cheaper to build small tools than to license them. Especially when you can more deeply customize and integrate them, which you often simply can't with off-the-shelf software.