This is a well-understood concept in factories. Not enough people today have ever been in a factory.
It's a classic problem with manufacturing plants that make a large number of different items. There, it's obvious - you have racks or piles or bins of partially finished product sitting around. Yet you can't avoid some of that, because machines have setup and teardown times. So you make a thousand stampings of thing A, which then wait for the next step. If you only made a lot of 100, there would be less work in progress, but more time the stamping machine wasn't running while the dies were changed. If you made a lot of 10,000, the stamping machine's efficiency would be higher but you'd have more work in progress. So, what's the optimal lot size?
This is a classic business school problem.[1] There's a whole theory of this, dating back to 1913.
Apple is famous for having botched this with their Macintosh factory in Fremont.[2] They centered their factory around an automated storage and retrieval system. This meant they could buffer a lot of work in process without making a visible mess. Wrong approach.