I'd always looked at it as there being '2 strands' within the company.
There's the main one, where you "make the money" - this (obviously) has to be profitable at all costs. Then there's the other than intertwines around this to serve the first indirectly - and you can be more flexible here.
e.g. Revenue from google's adwords has to support the cost of their infrastructure and free services - if that's ticking along well, you can have the nice buildings, free chef meals etc. This can be turned up and down depending on the market.
Counter-example that springs to mind is AvE's Juicero teardown - https://www.youtube.com/watch?v=_Cp-BGQfpHQ&ab_channel=AvE
Their product was lavishly over-engineered and beautifully made at vast expense - they were never going to make their costs back however over-priced their fruit-pods were. The more customers they got, the more it was going to cost. Frankly didn't make any difference if the Juicero staff were getting free meals or not (or had their salaries halved) - the lack of frugality at the core of their business doomed them.