Why is it that, in calculus of variations (specifically Euler-Lagrange), we can take the derivative of a function with respect to a function $f$ and set this derivative to $0$ if only $f'$ appears in $L$? For example the standard distance formula:
$$ D = \int dx \sqrt{1 + f'(x)^2} $$
The Euler-Lagrange formula is thus:
$\frac{\partial L}{\partial f} - \frac{d}{dx} \frac{\partial L}{\partial (\frac{\partial f}{\partial x})} = 0.$
In the Wikipedia example it asserts that "Since f does not appear explicitly in $L$, the first term in the Euler-Lagrange equation vanishes for all $f(x)$". I have a hard time understanding this because to me it feels like $f'(x)$ should depend on $f$, and so just setting the derivative to be $0$ goes against my intuition. Is there a way I could think about this to have it make more sense?