When one evaluation is expensive
Most optimization you meet assumes evaluations are cheap and gradients are available: run the function millions of times, follow the slope downhill. A large class of real problems breaks both assumptions.
Training a neural network to score one hyperparameter setting can take hours on a GPU. Measuring the yield of one chemical recipe means running a physical experiment. Simulating one aircraft wing takes a compute cluster overnight. In each case a single evaluation is expensive, so your entire budget might be fifty or a hundred tries, not millions.
These functions are also black boxes. You put in a configuration and get out a number, with no formula to differentiate and no gradient to follow. Bayesian optimization is the standard method for exactly this regime: derivative-free, expensive, and evaluation-limited.

