In many variational problems one is given an action $S\mapsto S[f]$, where $S[f]$ as some integral description $$ S[f]=\int_\Omega L\bigl(\;x,f(x),D f(x),\dotsc, D^k f(x)\;\bigr) dx $$ where $\Omega$ is a region in some Euclidean space $\mathbb{R}^n$, $x\in\Omega$, $f$ is a $k$-times differentiable function $f: \Omega\to\mathbb{R}^m$, and the Lagrangial $L$ is a function of the appropriate number of variables. For example in classical mechanics $\Omega$ is an interval, $f:\Omega\to \mathbb{R}^m$ describes a path in $\mathbb{R}^m$ and the Lagrangian has the form $L(y,v)=K(v)-U(y): \mathbb{R}^m\times\mathbb{R}^m\to \mathbb{R}$, i.e., $\newcommand{\bR}{\mathbb{R}}$ $$L(y,v)=\frac{1}{2}|v|^2-U(y), \;\; (y,v)\in\bR^m\times\bR^m $$ so that $$ L(f,\dot{f})= \frac{1}{2}|\dot{f}|^2-U\bigl(f\bigr), $$ where the dot indicates the derivative with respect to the time parameter $t$ on $\Omega\subset\mathbb{R}$. The functional (or variational) derivative of $S$ calculated at $f_0:\Omega\to\mathbb{R}^m$ is a gadget $\delta S[f_0]$ that feeds on an infinitesimal deformation $\delta f$ of $f_0$ and returns a scalar $$ \langle \delta S[f_0], \delta f\rangle =\lim_{h\to 0}\frac{1}{h} \bigl(S[f_0+h\delta f]-S[f_0]\;\bigr). \tag{1}$$ The deformation $\delta f$ is also a function $\Omega\to\mathbb{R}^m$. It is often desirable to identify $\delta S[f_0]$ with a function $g:\Omega\to\mathbb{R}^m$ which, if it exists, is uniquely determined by the equality $$ \langle \delta S[f_0], \delta f\rangle=\langle g(x), \delta f(x)\rangle =\int_\Omega \bigl( g(x), \delta f(x) \bigr) dx,\tag{2} $$ where $(-,-)$ denotes the natural inner product on $\mathbb{R}^m$. The value of $g$ at $x_0$ can be obtained from the equality $$ g(x_0)= \langle g(x), \delta(x-x_0)\rangle. \tag{3} $$ This means that the value of $g$ at $x_0$ is obtained by formally replacing $\delta f$ with $\delta(y-x_0)$ in (2). Making the same formal replacement $\delta f(x)\to\delta(x-x_0)$ in (1) one obtains the physicists' functional derivative in your question. How does one identify $\delta S[f_0]$ with a function? In the example from classical mechanics one has $$ S[f_0](t)=\frac{d}{dt}\frac{\partial L}{\partial v}(f_0(t), \dot{f_0}(t))-\frac{\partial L}{\partial x}(f_0,\dot{f}_0). $$ A good place to look for more details is the book "*Calculus of Variations*" by Gelfand and Fomin,Dover 2000.