I don't know what all those people at Twitter where doing, but I have worked at large companies and many engineers where working on developing possible new products and revenue streams, many of which, for different reasons, never see the light of day. If you're just looking at it from the outside it looks like there are a lot of people literally producing nothing.
With all that being said, I'm sure there are lots of companies out there (including pre Musk Twitter) who could lose a bunch of people without it affecting their bottom line or long term productivity.