Edit: This question attracted way more interest than I hoped for! I will need some time to go through the comments in the next days, thanks for your efforts everyone. One thing I could grasp from the answers already - it seems to be complicated. There is no one fits all answer.
Under capitalism, it seems companies always need to grow bigger. Why can’t they just say, okay, we have 100 employees and produce a nice product for a specific market and that’s fine?
Or is this only a US megacorp thing where they need to grow to satisfy their shareholders?
Let’s ignore that most of the times the small companies get bought by the large ones.
Shareholder demands are part of it, but also consider the pressures from competition, inflation, and debt.
If a firm isn’t growing, competition will outgrow them and then gobble up their market share. If you have 100 employees and produce a nice product, you’ll lose out to the firm that has 1000 employees and produces a nicer product. The competition is always growing, so your firm has to grow too. This leads to inflation - as every firm grows in competition with each other they heat up the economy and create more demand for fiat currency - so that means a firm needs to bring in more money every year just to stay afloat. And lastly, companies start out in debt and have to pay it off, and then accumulate more debt in order to outgrow the competition and outgrow inflation, which then in turn heats up competition even more and also causes more inflation.
Competition, inflation, and debt are part of a feedback loop that eventually results in overproduction and market collapse, the surviving firms buy each other out, and the process starts all over again. This is why markets go through boom and bust cycles.
It’s a very irrational system that produces a lot of waste.