Balancing two opposite costs
Ordering often costs money in transport, admin and time. Ordering rarely costs money in cash tied up, storage and spoilage. Economic order quantity is the size that makes the sum of those two smallest.
The formula assumes steady demand and a stable cost to order, which is rarely exactly true, so treat the result as a sensible starting quantity to adjust rather than an instruction.