Imagine you buy for X, and sell to some supermarket for Y, and they pay you in T time.
Optimum Y is not related to X, but the price when you replace the stock. ( let's say X2 ) When supply has problems, or economy is unpredictable, it is harder to predict X2, so usually your estimation is a bit off.
So you have to have bigger margin to cover for this estimation error. ( assume the worst )