So how much you need is a forecast, or more precisely, a range of forecasts that depend on what you and your competitors will sell. Your order will say "I commit to buying x and want an option on y more" and a larger x gets you a lower unit price for the first x you buy.
If the vendor's production capacity is within your forecasts, or near it, why shouldn't you just commit to order everything and get a nice low unit price? You'll lose if your forecasts are very wrong, but then that's true whatever you do. It sucks for your competitors, who did not order according to their own forecasts.
These are separate things (getting to the point of large scale production and blocking your competitors), e.g they could have played fair with the same initial success without excessive overstocking, allowing their competitors to continue competing and letting market forces decide, and letting suppliers gradually match current demand.
In short, there is no advantage to overstocking to such an excess other than to block your competitors. But you can only do so once you have a foot in the door and enough money to do so.
What I recall is them being production limited over and over again because their best wasn’t always good enough to stay ahead of demand. Nobody has talked about them hoarding.
Blocking competition was a benefit, but not the goal.
Apple is obviously not going to buy less so their competition can have more when Apple needed the supply.
The fact that it's one of severel effects and one of several motivations does not make it unintentional, or even necessarily just a side effect.
It could just as well be simply one of multiple fully considered effects, and surely was.
They either needed that many because they were selling that many.
Or bought way more to stop others from buying.